Frequency response optimization control system

ABSTRACT

A frequency response optimization system includes a battery configured to store and discharge electric power, a power inverter configured to control an amount of the electric power stored or discharged from the battery, a high level controller, and a low level controller. The high level controller is configured to receive a regulation signal from an incentive provider, determine statistics of the regulation signal, and use the statistics of the regulation signal to generate an optimal frequency response midpoint. The optimal midpoint achieves a desired change in the state-of-charge of the battery while participating in a frequency response program. The low level controller is configured to use the midpoints to determine optimal battery power setpoints for the power inverter. The power inverter is configured to use the optimal battery power setpoints to control an amount of the electric power stored or discharged from the battery.

CROSS-REFERENCE TO RELATED PATENT APPLICATION

This application claims the benefit of and priority to U.S. ProvisionalPatent Application No. 62/368,878 filed Jul. 29, 2016, the entiredisclosure of which is incorporated by reference herein.

BACKGROUND

The present disclosure relates generally to frequency response systemsconfigured to add or remove electricity from an energy grid, and moreparticularly to a frequency response controller that determines optimalpower setpoints for a battery power inverter in a frequency responsesystem.

Stationary battery storage has several purposes when integrated withcampus electrical distribution. For example, battery storage can be usedto participate in a local frequency response program. Battery storagecan be used to reduce the energy used during times when electricity isexpensive and to reduce the electrical demand of a building to reducethe demand charge incurred.

Some frequency response programs allow participants to set the midpointof regulation around which they must modify their load in response to aregulation signal. However, it is difficult and challenging to determinean optimal adjustment of the midpoint which allows the battery storagecontroller to actively participate in the frequency response marketwhile also taking into account the energy and demand charge that will beincurred.

SUMMARY

One implementation of the present disclosure is a frequency responseoptimization system. The system includes a battery that stores anddischarges electric power, a power inverter that controls an amount ofthe electric power stored or discharged from the battery at each of aplurality of time steps during a frequency response period, and a highlevel controller. The high level controller receives a regulation signalfrom an incentive provider, determines statistics of the regulationsignal, and uses the statistics of the regulation signal to generate afrequency response midpoint. The midpoint maintains the battery at thesame state-of-charge at a beginning and an end of the frequency responseperiod while participating in a frequency response program. A low levelcontroller uses the midpoint to determine optimal battery powersetpoints for the power inverter. The power inverter uses the optimalbattery power setpoints to control the amount of the electric powerstored or discharged from the battery.

In some embodiments, the low level controller is a network automationengine controller.

In some embodiments, the low level controller communicates with abattery management unit configured to monitor one or more parametersassociated with the battery.

In some embodiments, the parameters include a state of charge (SOC) ofthe battery, a depth of discharge of the battery, and a battery celltemperature.

In some embodiments, the low level controller communicates with aninput/output module in communication with a number of sub-systemsassociated with the battery.

In some embodiments, the sub-systems includes an environmental systemconfigured to regulate the environment of the battery.

In some embodiments, the sub-systems include a safety system configuredto provide safety and security information related to the battery to thelow level controller.

In some embodiments, the high level controller includes a battery powerloss estimator configured to estimate an amount of power lost in thebattery based on the statistics of the regulation signal.

In some embodiments, the high level controller generates filterparameters based on the midpoint. Additionally, the low level controlleruses the filter parameters to filter the regulation signal anddetermines the optimal battery power setpoints using the filteredregulation signal.

In some embodiments, the high level controller generates an objectivefunction. The objective function includes an estimated amount offrequency response revenue that will result from the battery powersetpoints, and an estimated cost of battery degradation that will resultfrom the battery power setpoints.

In some embodiments, the frequency response controller implementsconstraints on the objective function. The constraints may include atleast one of constraining a state-of-charge of the battery between aminimum state-of-charge and a maximum state-of-charge and constrainingthe midpoint such that a sum of the midpoint and a campus power usagedoes not exceed a maximum power rating of the power inverter.

In some embodiments, the frequency response controller uses a batterylife model to determine an estimated cost of battery degradation. Thebattery life model may include a plurality of variables that depend onthe battery power setpoints. The variables may include at least one of atemperature of the battery, a state-of-charge of the battery, a depth ofdischarge of the battery, a power ratio of the battery, and an effortratio of the battery.

Another implementation of the present disclosure is a frequency responseoptimization system. The system includes a battery that stores anddischarges electric power, a power inverter that controls an amount ofthe electric power stored or discharged from the battery at each of aplurality of time steps during a frequency response period, and a highlevel controller. The high level controller receives a regulation signalfrom an incentive provider, determines statistics of the regulationsignal, and uses the statistics of the regulation signal to generate anoptimal frequency response midpoint. The optimal midpoint achieves adesired change in the state-of-charge of the battery while participatingin a frequency response program. A low level controller uses themidpoints to determine optimal battery power setpoints for the powerinverter. The power inverter uses the optimal battery power setpoints tocontrol the amount of the electric power stored or discharged from thebattery.

In some embodiments, the frequency response controller includes abattery power loss estimator that estimates an amount of power lost inthe battery based on the statistics of the regulation signal.

In some embodiments, the high level controller generates filterparameters based on the optimal midpoint and a low level controller thatuses the filter parameters to filter the regulation signal anddetermines the optimal battery power setpoints using the filteredregulation signal. In some embodiments, the high level controllergenerates an objective function including an estimated amount offrequency response revenue that will result from the midpoint and anestimated cost of battery degradation that will result from themidpoint.

In some embodiments, the high level controller implements constraints onthe objective function. The constraints may include at least one ofconstraining a state-of-charge of the battery between a minimumstate-of-charge and a maximum state-of-charge and constraining themidpoint such that a sum of the midpoint and a campus power usage doesnot exceed a maximum power rating of the power inverter.

Another implementation of the present disclosure is an optimizationcontroller for a battery. The optimization controller includes a highlevel controller that receives a regulation signal from an incentiveprovider, determines statistics of the regulation signal, and uses thestatistics of the regulation signal to generate a frequency responsemidpoint. The optimization controller further includes a low levelcontroller that uses the frequency response midpoint to determineoptimal battery power setpoints and uses the optimal battery powersetpoints to control an amount of electric power stored or dischargedfrom the battery during a frequency response period.

In some embodiments, the high level controller determines the frequencyresponse midpoint that maintains the battery at the same state-of-chargeat a beginning and an end of the frequency response period whileparticipating in a frequency response program.

In some embodiments, the high level controller determines an optimalfrequency response midpoint that achieves a desired change in thestate-of-charge of the battery while participating in a frequencyresponse program.

Those skilled in the art will appreciate that the summary isillustrative only and is not intended to be in any way limiting. Otheraspects, inventive features, and advantages of the devices and/orprocesses described herein, as defined solely by the claims, will becomeapparent in the detailed description set forth herein and taken inconjunction with the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of a frequency response optimization system,according to some embodiments.

FIG. 2 is a graph of a regulation signal which may be provided to thesystem of FIG. 1 and a frequency response signal which may be generatedby the system of FIG. 1, according to some embodiments.

FIG. 3 is a block diagram illustrating the optimization controller ofFIG. 1 in greater detail, according to some embodiments.

FIG. 4 is a block diagram illustrating the high level controller of FIG.3 in greater detail, according to some embodiments.

FIG. 5 is a block diagram illustrating the low level controller of FIG.3 in greater detail, according to some embodiments.

FIG. 6 is a system view of the system of FIG. 1, in greater detail,according to some embodiments.

DETAILED DESCRIPTION

Frequency Response Optimization

Referring to FIG. 1, a battery optimization system 100 is shown,according to an exemplary embodiment. System 100 is shown to include acampus 102 and an energy grid 104. Campus 102 may include one or morebuildings 116 that receive power from energy grid 104. Buildings 116 mayinclude equipment or devices that consume electricity during operation.For example, buildings 116 may include HVAC equipment, lightingequipment, security equipment, communications equipment, vendingmachines, computers, electronics, elevators, or other types of buildingequipment. In some embodiments, buildings 116 are served by a buildingmanagement system (BMS). A BMS is, in general, a system of devicesconfigured to control, monitor, and manage equipment in or around abuilding or building area. A BMS can include, for example, an HVACsystem, a security system, a lighting system, a fire alerting system,and/or any other system that is capable of managing building functionsor devices. An exemplary building management system which may be used tomonitor and control buildings 116 is described in U.S. patentapplication Ser. No. 14/717,593, titled “Building Management System forForecasting Time Series Values of Building Variables” and filed May 20,2015, the entire disclosure of which is incorporated by referenceherein.

In some embodiments, campus 102 includes a central plant 118. Centralplant 118 may include one or more subplants that consume resources fromutilities (e.g., water, natural gas, electricity, etc.) to satisfy theloads of buildings 116. For example, central plant 118 may include aheater subplant, a heat recovery chiller subplant, a chiller subplant, acooling tower subplant, a hot thermal energy storage (TES) subplant, anda cold thermal energy storage (TES) subplant, a steam subplant, and/orany other type of subplant configured to serve buildings 116. Thesubplants may be configured to convert input resources (e.g.,electricity, water, natural gas, etc.) into output resources (e.g., coldwater, hot water, chilled air, heated air, etc.) that are provided tobuildings 116. An exemplary central plant which may be used to satisfythe loads of buildings 116 is described U.S. patent application Ser. No.14/634,609, titled “High Level Central Plant Optimization” and filedFeb. 27, 2015, the entire disclosure of which is incorporated byreference herein.

In some embodiments, campus 102 includes energy generation 120. Energygeneration 120 may be configured to generate energy that can be used bybuildings 116, used by central plant 118, and/or provided to energy grid104. In some embodiments, energy generation 120 generates electricity.For example, energy generation 120 may include an electric power plant,a photovoltaic energy field, or other types of systems or devices thatgenerate electricity. The electricity generated by energy generation 120can be used internally by campus 102 (e.g., by buildings 116 and/orcentral plant 118) to decrease the amount of electric power that campus102 receives from outside sources such as energy grid 104 or battery108. If the amount of electricity generated by energy generation 120exceeds the electric power demand of campus 102, the excess electricpower can be provided to energy grid 104 or stored in battery 108. Thepower output of campus 102 is shown in FIG. 1 as P_(campus). P_(campus)may be positive if campus 102 is outputting electric power or negativeif campus 102 is receiving electric power.

Still referring to FIG. 1, system 100 is shown to include a powerinverter 106 and a battery 108. Power inverter 106 may be configured toconvert electric power between direct current (DC) and alternatingcurrent (AC). For example, battery 108 may be configured to store andoutput DC power, whereas energy grid 104 and campus 102 may beconfigured to consume and generate AC power. Power inverter 106 may beused to convert DC power from battery 108 into a sinusoidal AC outputsynchronized to the grid frequency of energy grid 104. Power inverter106 may also be used to convert AC power from campus 102 or energy grid104 into DC power that can be stored in battery 108. The power output ofbattery 108 is shown as P_(bat). P_(bat) may be positive if battery 108is providing power to power inverter 106 or negative if battery 108 isreceiving power from power inverter 106.

In some instances, power inverter 106 receives a DC power output frombattery 108 and converts the DC power output to an AC power output thatcan be fed into energy grid 104. Power inverter 106 may synchronize thefrequency of the AC power output with that of energy grid 104 (e.g., 50Hz or 60 Hz) using a local oscillator and may limit the voltage of theAC power output to no higher than the grid voltage. In some embodiments,power inverter 106 is a resonant inverter that includes or uses LCcircuits to remove the harmonics from a simple square wave in order toachieve a sine wave matching the frequency of energy grid 104. Invarious embodiments, power inverter 106 may operate using high-frequencytransformers, low-frequency transformers, or without transformers.Low-frequency transformers may convert the DC output from battery 108directly to the AC output provided to energy grid 104. High-frequencytransformers may employ a multi-step process that involves convertingthe DC output to high-frequency AC, then back to DC, and then finally tothe AC output provided to energy grid 104.

System 100 is shown to include a point of interconnection (POI) 110. POI110 is the point at which campus 102, energy grid 104, and powerinverter 106 are electrically connected. The power supplied to POI 110from power inverter 106 is shown as P_(sup). P_(sup) may be defined asP_(bat)+P_(loss), where P_(bat) is the battery power and P_(loss) is thepower loss in the battery system (e.g., losses in power inverter 106and/or battery 108). P_(sup) may be positive is power inverter 106 isproviding power to POI 110 or negative if power inverter 106 isreceiving power from POI 110. P_(campus) and P_(sup) combine at POI 110to form P_(POI). P_(POI) may be defined as the power provided to energygrid 104 from POI 110. P_(POI) may be positive if POI 110 is providingpower to energy grid 104 or negative if POI 110 is receiving power fromenergy grid 104.

Still referring to FIG. 1, system 100 is shown to include anoptimization controller 112. Controller 112 may be configured togenerate and provide power setpoints to power inverter 106. Powerinverter 106 may use the power setpoints to control the amount of powerP_(sup) provided to POI 110 or drawn from POI 110. For example, powerinverter 106 may be configured to draw power from POI 110 and store thepower in battery 108 in response to receiving a negative power setpointfrom controller 112. Conversely, power inverter 106 may be configured todraw power from battery 108 and provide the power to POI 110 in responseto receiving a positive power setpoint from controller 112. Themagnitude of the power setpoint may define the amount of power P_(sup)provided to or from power inverter 106. Controller 112 may be configuredto generate and provide power setpoints that optimize the value ofoperating system 100 over a time horizon.

In some embodiments, optimization controller 112 uses power inverter 106and battery 108 to perform frequency regulation for energy grid 104.Frequency regulation is the process of maintaining the stability of thegrid frequency (e.g., 60 Hz in the United States). The grid frequencymay remain stable and balanced as long as the total electric supply anddemand of energy grid 104 are balanced. Any deviation from that balancemay result in a deviation of the grid frequency from its desirablevalue. For example, an increase in demand may cause the grid frequencyto decrease, whereas an increase in supply may cause the grid frequencyto increase. Optimization controller 112 may be configured to offset afluctuation in the grid frequency by causing power inverter 106 tosupply energy from battery 108 to energy grid 104 (e.g., to offset adecrease in grid frequency) or store energy from energy grid 104 inbattery 108 (e.g., to offset an increase in grid frequency).

In some embodiments, optimization controller 112 uses power inverter 106and battery 108 to perform load shifting for campus 102. For example,controller 112 may cause power inverter 106 to store energy in battery108 when energy prices are low and retrieve energy from battery 108 whenenergy prices are high in order to reduce the cost of electricityrequired to power campus 102. Load shifting may also allow system 100reduce the demand charge incurred. Demand charge is an additional chargeimposed by some utility providers based on the maximum power consumptionduring an applicable demand charge period. For example, a demand chargerate may be specified in terms of dollars per unit of power (e.g., $/kW)and may be multiplied by the peak power usage (e.g., kW) during a demandcharge period to calculate the demand charge. Load shifting may allowsystem 100 to smooth momentary spikes in the electric demand of campus102 by drawing energy from battery 108 in order to reduce peak powerdraw from energy grid 104, thereby decreasing the demand chargeincurred.

Still referring to FIG. 1, system 100 is shown to include an incentiveprovider 114. Incentive provider 114 may be a utility (e.g., an electricutility), a regional transmission organization (RTO), an independentsystem operator (ISO), or any other entity that provides incentives forperforming frequency regulation. For example, incentive provider 114 mayprovide system 100 with monetary incentives for participating in afrequency response program. In order to participate in the frequencyresponse program, system 100 may maintain a reserve capacity of storedenergy (e.g., in battery 108) that can be provided to energy grid 104.System 100 may also maintain the capacity to draw energy from energygrid 104 and store the energy in battery 108. Reserving both of thesecapacities may be accomplished by managing the state-of-charge ofbattery 108.

Optimization controller 112 may provide incentive provider 114 with aprice bid and a capability bid. The price bid may include a price perunit power (e.g., $/MW) for reserving or storing power that allowssystem 100 to participate in a frequency response program offered byincentive provider 114. The price per unit power bid by optimizationcontroller 112 is referred to herein as the “capability price.” Theprice bid may also include a price for actual performance, referred toherein as the “performance price.” The capability bid may define anamount of power (e.g., MW) that system 100 will reserve or store inbattery 108 to perform frequency response, referred to herein as the“capability bid.”

Incentive provider 114 may provide optimization controller 112 with acapability clearing price CP_(cap), a performance clearing priceCP_(perf), and a regulation award Reg_(award), which correspond to thecapability price, the performance price, and the capability bid,respectively. In some embodiments, CP_(cap), CP_(perf), and Reg_(award)are the same as the corresponding bids placed by controller 112. Inother embodiments, CP_(cap), CP_(perf), and Reg_(award) may not be thesame as the bids placed by controller 112. For example, CP_(cap),CP_(perf), and Reg_(award) may be generated by incentive provider 114based on bids received from multiple participants in the frequencyresponse program. Controller 112 may use CP_(cap), CP_(perf), andReg_(award) to perform frequency regulation, described in greater detailbelow.

Optimization controller 112 is shown receiving a regulation signal fromincentive provider 114. The regulation signal may specify a portion ofthe regulation award Reg_(award) that optimization controller 112 is toadd or remove from energy grid 104. In some embodiments, the regulationsignal is a normalized signal (e.g., between −1 and 1) specifying aproportion of Reg_(award). Positive values of the regulation signal mayindicate an amount of power to add to energy grid 104, whereas negativevalues of the regulation signal may indicate an amount of power toremove from energy grid 104.

The optimization controller 112 may respond to the regulation signal bygenerating an optimal power setpoint for power inverter 106. The optimalpower setpoint may take into account both the potential revenue fromparticipating in the frequency response program and the costs ofparticipation. Costs of participation may include, for example, amonetized cost of battery degradation as well as the energy and demandcharges that will be incurred. The optimization may be performed usingsequential quadratic programming, dynamic programming, or any otheroptimization technique.

In some embodiments, controller 112 uses a battery life model toquantify and monetize battery degradation as a function of the powersetpoints provided to power inverter 106. Advantageously, the batterylife model allows controller 112 to perform an optimization that weighsthe revenue generation potential of participating in the frequencyresponse program against the cost of battery degradation and other costsof participation (e.g., less battery power available for campus 102,increased electricity costs, etc.). An exemplary regulation signal andpower response are described in greater detail with reference to FIG. 2.

Referring now to FIG. 2, a pair of frequency response graphs 200 and 250are shown, according to an exemplary embodiment. Graph 200 illustrates aregulation signal Reg_(signal) 202 as a function of time. Reg_(signal)202 is shown as a normalized signal ranging from −1 to 1 (i.e.,−1≤Reg_(signal)≤1). Reg_(signal) 202 may be generated by incentiveprovider 114 and provided to optimization controller 112. Reg_(signal)202 may define a proportion of the regulation award Reg_(award) 254 thatcontroller 112 is to add or remove from energy grid 104, relative to abaseline value referred to as the midpoint b 256. For example, if thevalue of Reg_(award) 254 is 10 MW, a regulation signal value of 0.5(i.e., Reg_(signal)=0.5) may indicate that system 100 is requested toadd 5 MW of power at POI 110 relative to midpoint b (e.g., P*_(POI)=10MW×0.5+b), whereas a regulation signal value of −0.3 may indicate thatsystem 100 is requested to remove 3 MW of power from POI 110 relative tomidpoint b (e.g., P*_(POI)=10 MW×−0.3+b).

Graph 250 illustrates the desired interconnection power P*_(POI) 252 asa function of time. P*_(POI) 252 may be calculated by optimizationcontroller 112 based on Reg_(signal) 202, Reg_(award) 254, and amidpoint b 256. For example, controller 112 may calculate P*_(POI) 252using the following equation:P* _(POI) =Reg _(award) ×Reg _(signal) +bwhere P*_(POI) represents the desired power at POI 110 (e.g.,P*_(POI)=P_(sup)+P_(campus)) and b is the midpoint. Midpoint b may bedefined (e.g., set or optimized) by controller 112 and may represent themidpoint of regulation around which the load is modified in response toReg_(signal) 202. Optimal adjustment of midpoint b may allow controller112 to actively participate in the frequency response market while alsotaking into account the energy and demand charge that will be incurred.

In order to participate in the frequency response market, controller 112may perform several tasks. Controller 112 may generate a price bid(e.g., $/MW) that includes the capability price and the performanceprice. In some embodiments, controller 112 sends the price bid toincentive provider 114 at approximately 15:30 each day and the price bidremains in effect for the entirety of the next day. Prior to beginning afrequency response period, controller 112 may generate the capabilitybid (e.g., MW) and send the capability bid to incentive provider 114. Insome embodiments, controller 112 generates and sends the capability bidto incentive provider 114 approximately 1.5 hours before a frequencyresponse period begins. In an exemplary embodiment, each frequencyresponse period has a duration of one hour; however, it is contemplatedthat frequency response periods may have any duration.

At the start of each frequency response period, controller 112 maygenerate the midpoint b around which controller 112 plans to performfrequency regulation. In some embodiments, controller 112 generates amidpoint b that will maintain battery 108 at a constant state-of-charge(SOC) (i.e. a midpoint that will result in battery 108 having the sameSOC at the beginning and end of the frequency response period). In otherembodiments, controller 112 generates midpoint b using an optimizationprocedure that allows the SOC of battery 108 to have different values atthe beginning and end of the frequency response period. For example,controller 112 may use the SOC of battery 108 as a constrained variablethat depends on midpoint b in order to optimize a value function thattakes into account frequency response revenue, energy costs, and thecost of battery degradation. Exemplary processes for calculating and/oroptimizing midpoint b under both the constant SOC scenario and thevariable SOC scenario are described in greater detail with reference toFIGS. 3-4.

During each frequency response period, controller 112 may periodicallygenerate a power setpoint for power inverter 106. For example,controller 112 may generate a power setpoint for each time step in thefrequency response period. In some embodiments, controller 112 generatesthe power setpoints using the equation:P* _(POI) =Reg _(award) ×Reg _(signal) +bwhere P*_(POI)=P_(sup)+P_(campus). Positive values of P*_(POI) indicateenergy flow from POI 110 to energy grid 104. Positive values of P_(sup)and P_(campus) indicate energy flow to POI 110 from power inverter 106and campus 102, respectively. In other embodiments, controller 112generates the power setpoints using the equation:P* _(POI) =Reg _(award) ×Res _(FR) +bwhere Res_(FR) is an optimal frequency response generated by optimizinga value function (described in greater detail below). Controller 112 maysubtract P_(campus) from P*_(POI) to generate the power setpoint forpower inverter 106 (i.e., P_(sup)=P*_(POI)−P_(campus)). The powersetpoint for power inverter 106 indicates the amount of power that powerinverter 106 is to add to POI 110 (if the power setpoint is positive) orremove from POI 110 (if the power setpoint is negative).Optimization Control System

Referring now to FIG. 3, a block diagram illustrating optimizationcontroller 112 in greater detail is shown, according to an exemplaryembodiment. Optimization controller 112 may be configured to perform anoptimization process to generate values for the bid price, thecapability bid, and the midpoint b. In some embodiments, optimizationcontroller 112 generates values for the bids and the midpoint bperiodically using a predictive optimization scheme (e.g., once everyhalf hour, once per frequency response period, etc.). Optimizationcontroller 112 may also calculate and update power setpoints for powerinverter 106 periodically during each frequency response period (e.g.,once every two seconds). As shown in FIG. 3, optimization controller 112is in communication with one or more external systems via communicationinterface 302. Additionally, optimization controller 112 is also shownas being in communication with a battery system 304.

In some embodiments, the interval at which optimization controller 112generates power setpoints for power inverter 106 is significantlyshorter than the interval at which optimization controller 112 generatesthe bids and the midpoint b. For example, optimization controller 112may generate values for the bids and the midpoint b every half hour,whereas optimization controller 112 may generate a power setpoint forpower inverter 106 every two seconds. The difference in these timescales allows optimization controller 112 to use a cascaded optimizationprocess to generate optimal bids, midpoints b, and power setpoints.

In the cascaded optimization process, a high level controller 306determines optimal values for the bid price, the capability bid, and themidpoint b by performing a high level optimization. High levelcontroller 306 may be a centralized server within the optimizationcontroller 112. High level controller 306 may be configured to executeoptimization control algorithms, such as those described herein. In oneembodiment, high level controller 306 is be configured to run anoptimization engine, such as a MATLAB optimization engine. High levelcontroller 306 is described in more detail below.

Further, the cascaded optimization process allows for multiplecontrollers to process different portions of the optimization process.As described below, high level controller 306 may be used to performoptimization functions based on received data, while a low levelcontroller 308 may receive optimization data from high level controller306 and control battery system 304 accordingly. By allowing independentplatforms to perform separation portions of the optimization, theindividual platforms may be scaled and tuned independently. For example,optimization controller 112 may be able to be scaled up to accommodate alarger battery system 304 by adding additional low level controllers tocontrol battery system 304. Further, high level controller 306 may bemodified to provide additional computing power for optimizing batterysystem 304 in more complex systems. Further, modifications to eitherhigh level controller 306 or low level controller 308 may not affect theother, thereby increasing overall system stability and availability.

High level controller 306 may select midpoint b to maintain a constantstate-of-charge in battery 108 (i.e., the same state-of-charge at thebeginning and end of each frequency response period) or to vary thestate-of-charge in order to optimize the overall value of operatingsystem 100 (e.g., frequency response revenue minus energy costs andbattery degradation costs), as described below. High level controller306 may also determine filter parameters for a signal filter (e.g., alow pass filter) used by low level controller 308.

Low level controller 308 may be a standalone controller. In oneembodiment, low level controller 308 is a Network Automation Engine(NAE) controller from Johnson Controls. However, other controllershaving the capabilities described herein are also contemplated. Lowlevel controller 308 may have sufficient memory and computing power torun the applications, described below, at the required frequencies. Forexample, certain optimization control loops (described below) mayrequire control loops running at 200 ms intervals. However, intervals ofmore than 200 ms and less than 200 ms may also be required. Thesecontrol loops may require reading and writing data to and from thebattery inverter. Low level controller 308 may support Ethernetconnectivity (or other network connectivity) to connect to a network forreceiving both operational data, as well as configuration data.

Low level controller 308 may be capable of quickly controlling one ormore devices around one or more setpoints. For example, low levelcontroller 308 can use the midpoint b and the filter parameters fromhigh level controller 306 to perform a low level optimization in orderto generate the power setpoints for power inverter 106. Advantageously,low level controller 308 may determine how closely to track the desiredpower P*_(POI) at the point of interconnection 110. For example, the lowlevel optimization performed by low level controller 308 may considernot only frequency response revenue but also the costs of the powersetpoints in terms of energy costs and battery degradation. In someinstances, low level controller 308 may determine that it is deleteriousto battery 108 to follow the regulation exactly and may sacrifice aportion of the frequency response revenue in order to preserve the lifeof battery 108.

Low level controller 308 may also be configured to interface with one ormore other devises or systems. For example, low level controller 308 maycommunicate with power inverter 106 and/or battery management unit 310via a low level controller communications interface 312. Communicationsinterface 312 may include wired or wireless interfaces (e.g., jacks,antennas, transmitters, receivers, transceivers, wire terminals, etc.)for conducting data communications with various systems, devices, ornetworks. For example, communications interface 312 may include anEthernet card and port for sending and receiving data via anEthernet-based communications network and/or a Wi-Fi transceiver forcommunicating via a wireless communications network. Communicationsinterface 312 may be configured to communicate via local area networksor wide area networks (e.g., the Internet, a building WAN, etc.) and mayuse a variety of communications protocols (e.g., BACnet, MODBUS, CAN,IP, LON, etc.).

As described above, low level controller 308 may communicate setpointsto power inverter 106. Furthermore, low level controller 308 may receivedata from battery management unit 310 via communication interface 312.Battery management unit 310 may provide data relating to a state ofcharge (SOC) of batteries 108. Battery management unit 310 may furtherprovide data relating to other parameters of batteries 108, such astemperature, real time or historical voltage level values, real time orhistorical current values, etc. Low level controller 308 may beconfigured to perform time critical functions of optimization controller112. For example, low level controller 308 may be able to perform fastloop (PID, PD, PI, etc.) controls in real time. In some embodiments, lowlevel controller 308 provides power setpoints to power inverter 106 viacommunications interface 312.

Low level controller 308 may further control a number of other systemsor devices associated with battery system 304. For example, low levelcontroller may control safety systems 316 and/or environmental systems318. In one embodiment, low level controller 308 may communicate withand control safety systems 316 and/or environmental systems 318 throughan input/output module (IOM) 319. In one example, IOM 319 may be an IOMcontroller from Johnson Controls. IOM 319 may be configured to receivedata from low level controller and then output discrete control signalsto safety systems 316 and/or environmental systems 318. Further, IOM 319may receive discrete outputs from safety systems 316 and/orenvironmental systems 318, and report those values to low levelcontroller 308. For example, IOM 319 may provide binary outputs toenvironmental system 318, such as a temperature setpoint. In return, IOM319 may receive one or more analog inputs corresponding to temperaturesor other parameters associated with environmental systems 318.Similarly, safety systems 316 may provide binary inputs to IOM 319indicating the status of one or more safety systems or devices withinbattery system 304. IOM 319 may be able to process multiple data pointsfrom devices within battery system 304. Further, IOM 319 may beconfigured to receive and output a variety of analog signals (4-20 mA,0-5V, etc.) as well as binary signals.

Environmental systems 318 may include HVAC devices such as roof-topunits (RTUs), air handling units (AHUs), etc. Environmental systems 318may be coupled to battery system 304 to provide environmental regulationof battery system 304. For example, environmental systems 318 mayprovide cooling for battery system 304. In one example, battery system304 may be contained within an environmentally sealed container.Environmental systems 318 may then be used to not only provide airflowthrough battery system 304, but also to condition the air to provideadditional cooling to batteries 108 and/or power inverter 106.Environmental systems 318 may also provide environmental services suchas air filtration, liquid cooling, heating, etc. Safety systems 316 mayprovide various safety controls and interlocks associated with thebattery system 304. For example, safety systems 316 may monitor one ormore contacts associated with access points on battery system 304. Wherea contact indicates that an access point is being accessed, safetysystems 316 may communicate the associated data to low level controller308 via IOM 319. Low level controller 308 may then generate and alarmand/or shut down battery system 304 to prevent any injury to a personaccessing battery system 304 during operation. Further examples ofsafety systems can include air quality monitors, smoke detectors, firesuppression systems, etc.

Still referring to FIG. 3, optimization controller 112 is shown toinclude a high level controller communications interface 302.Communications interface 302 may include wired or wireless interfaces(e.g., jacks, antennas, transmitters, receivers, transceivers, wireterminals, etc.) for conducting data communications with varioussystems, devices, or networks. For example, communications interface 302may include an Ethernet card and port for sending and receiving data viaan Ethernet-based communications network and/or a Wi-Fi transceiver forcommunicating via a wireless communications network. Communicationsinterface 302 may be configured to communicate via local area networksor wide area networks (e.g., the Internet, a building WAN, etc.) and mayuse a variety of communications protocols (e.g., BACnet, IP, LON, etc.).

Communications interface 302 may be a network interface configured tofacilitate electronic data communications between optimizationcontroller 112 and various external systems or devices (e.g., campus102, energy grid 104, incentive provider 114, utilities 320, weatherservice 322, etc.). For example, optimization controller 112 may receiveinputs from incentive provider 114 indicating an incentive event history(e.g., past clearing prices, mileage ratios, participation requirements,etc.) and a regulation signal. Further, the incentive provider 114 maycommunicate utility rates provided by utilities 320. Optimizationcontroller 112 may receive a campus power signal from campus 102, andweather forecasts from weather service 322 via communications interface302. Optimization controller 112 may provide a price bid and acapability bid to incentive provider 114 and may provide power setpointsto power inverter 106 via communications interface 302.

As described above, high level controller 306 may be configured togenerate values for the midpoint b and the capability bid Reg_(award).In some embodiments, high level controller 306 determines a midpoint bthat will cause battery 108 to have the same state-of-charge (SOC) atthe beginning and end of each frequency response period. In otherembodiments, high level controller 306 performs an optimization processto generate midpoint b and Reg_(award). For example, high levelcontroller 306 may generate midpoint b using an optimization procedurethat allows the SOC of battery 108 to vary and/or have different valuesat the beginning and end of the frequency response period. High levelcontroller 306 may use the SOC of battery 108 as a constrained variablethat depends on midpoint b in order to optimize a value function thattakes into account frequency response revenue, energy costs, and thecost of battery degradation. The SOC of the batteries 108 may beprovided by the battery management unit 310 via the low level controller308. Both of these embodiments are described in greater detail withreference to FIG. 4.

High level controller 306 may determine midpoint b by equating thedesired power P*_(POI) at POI 110 with the actual power at POI 110 asshown in the following equation:(Reg _(signal))(Reg _(award))+b=P _(bat) +P _(loss) +P _(campus)where the left side of the equation (Reg_(signal))(Reg_(award))+b is thedesired power P*_(POI) at POI 110 and the right side of the equation isthe actual power at POI 110. Integrating over the frequency responseperiod results in the following equation:

${\int\limits_{period}{\left( {{\left( {Reg}_{signal} \right)\left( {Reg}_{award} \right)} + b} \right){dt}}} = {\int_{period}{\left( {P_{bat} + P_{loss} + P_{campus}} \right){dt}}}$

For embodiments in which the SOC of battery 108 is maintained at thesame value at the beginning and end of the frequency response period,the integral of the battery power P_(bat) over the frequency responseperiod is zero (i.e., ∫P_(bat)dt=0). Accordingly, the previous equationcan be rewritten as follows:

$b = {{\int\limits_{period}{P_{loss}{dt}}} + {\int\limits_{period}{P_{campus}{dt}}} - {{Reg}_{award}{\int\limits_{period}{{Reg}_{signal}{dt}}}}}$where the term ∫P_(bat) dt has been omitted because ∫P_(bat) dt=0. Thisis ideal behavior if the only goal is to maximize frequency responserevenue. Keeping the SOC of battery 108 at a constant value (and near50%) will allow system 100 to participate in the frequency market duringall hours of the day.

High level controller 306 may use the estimated values of the campuspower signal received from campus 102 to predict the value off∫P_(campus) dt over the frequency response period. Similarly, high levelcontroller 306 may use the estimated values of the regulation signalfrom incentive provider 114 to predict the value of ∫Reg_(signal) dtover the frequency response period. High level controller 306 mayestimate the value of ∫P_(loss) dt using a Thevinin equivalent circuitmodel of battery 108 (described in greater detail with reference to FIG.4). This allows high level controller 306 to estimate the integral∫P_(loss) dt as a function of other variables such as Reg_(award),Reg_(signal), P_(campus), and midpoint b.

After substituting known and estimated values, the preceding equationcan be rewritten as follows:

$\frac{1}{4P_{{ma}\; x}}\left\lbrack {{E\left\{ P_{campus}^{2} \right\}} + {{Reg}_{award}^{2}E\left\{ {Reg}_{signal}^{2} \right\}} - {\quad{{\left. \quad{2{Reg}_{award}E\left\{ {Reg}_{signal} \right\} E\left\{ P_{campus} \right\}} \right\rbrack\Delta\; t} + {\quad{{{\left\lbrack {{{Reg}_{award}E\left\{ {Reg}_{signal} \right\}} - {E\left\{ P_{campus} \right\}}} \right\rbrack\Delta\; t} + {{\frac{b}{2P_{{ma}\; x}}\left\lbrack {{{Reg}_{award}E\left\{ {Reg}_{signal} \right\}} - {E\left\{ P_{campus} \right\}}} \right\rbrack}\Delta\; t} + {b\;\Delta\; t} + {\frac{b^{2}}{4P_{{ma}\; x}}\Delta\; t}} = 0}}}}} \right.$where the notation E{ } indicates that the variable within the brackets{ } is ergodic and can be approximated by the estimated mean of thevariable. For example, the term E{Reg_(signal)} can be approximated bythe estimated mean of the regulation signal μ_(FR) and the termE{P_(campus)} can be approximated by the estimated mean of the campuspower signal μ_(campus). High level controller 306 may solve theequation for midpoint b to determine the midpoint b that maintainsbattery 108 at a constant state-of-charge.

For embodiments in which the SOC of battery 108 is treated as avariable, the SOC of battery 108 may be allowed to have different valuesat the beginning and end of the frequency response period. Accordingly,the integral of the battery power P_(bat) over the frequency responseperiod can be expressed as −ΔSOC ·C_(des) as shown in the followingequation:

∫_(period)P_(bat) dt = −Δ SOC ⋅ C_(des)where ΔSOC is the change in the SOC of battery 108 over the frequencyresponse period and C_(des) is the design capacity of battery 108. TheSOC of battery 108 may be a normalized variable (i.e., 0≤SOC≤1) suchthat the term SOC ·C_(des) represents the amount of energy stored inbattery 108 for a given state-of-charge. The SOC is shown as a negativevalue because drawing energy from battery 108 (i.e., a positive P_(bat))decreases the SOC of battery 108. The equation for midpoint b becomes:

b = ∫_(period)P_(loss) dt + ∫_(period)P_(campus) dt + ∫_(period)P_(bat) dt − Reg_(award)∫_(period)Reg_(signal) dt

After substituting known and estimated values, the preceding equationcan be rewritten as follows:

${{\frac{1}{4P_{\max}}\left\lbrack {{E\left\{ P_{campus}^{2} \right\}} + {Reg}_{award}^{2} + {E\left\{ {Reg}_{signal}^{2} \right\}} - {2{Reg}_{award}E\left\{ {Reg}_{signal} \right\} E\left\{ P_{campus} \right\}}} \right\rbrack}\Delta\; t} + {\quad{{{\left\lbrack {{{Reg}_{award}E\left\{ {Reg}_{signal} \right\}} + {E\left\{ P_{campus} \right\}}} \right\rbrack\Delta\; t} + {\Delta\;{{SOC} \cdot C_{des}}} + {{\frac{b}{2P_{\max}}\left\lbrack {{{Reg}_{award}E\left\{ {Reg}_{signal} \right\}} - {E\left\{ P_{campus} \right\}}} \right\rbrack}\Delta\; t} + {b\;\Delta\; t} + {\frac{b^{2}}{4P_{\max}}\Delta\; t}} = 0}}$High level controller 306 may solve the equation for midpoint b in termsof ΔSOC.

High level controller 306 may perform an optimization to find optimalmidpoints b for each frequency response period within an optimizationwindow (e.g., each hour for the next day) given the electrical costsover the optimization window. Optimal midpoints b may be the midpointsthat maximize an objective function that includes both frequencyresponse revenue and costs of electricity and battery degradation. Forexample, an objective function J can be written as:

$J = {{\sum\limits_{k = 1}^{h}{{Rev}\left( {Reg}_{{award},k} \right)}} + {\sum\limits_{k = 1}^{h}{c_{k}b_{k}}} + {\min\limits_{period}\left( {P_{{campus},k} + b_{k}} \right)} - {\sum\limits_{k = 1}^{h}\lambda_{{bat},k}}}$where Rev(Reg_(award,k)) is the frequency response revenue at time stepk, c_(k)b_(k) is the cost of electricity purchased at time step k, themin( ) term is the demand charge based on the maximum rate ofelectricity consumption during the applicable demand charge period, andλ_(bat,k) is the monetized cost battery degradation at time step k. Theelectricity cost is expressed as a positive value because drawing powerfrom energy grid 104 is represented as a negative power and thereforewill result in negative value (i.e., a cost) in the objective function.The demand charge is expressed as a minimum for the same reason (i.e.,the most negative power value represents maximum power draw from energygrid 104).

High level controller 306 may estimate the frequency response revenueRev(Reg_(award,k)) as a function of the midpoints b. In someembodiments, high level controller 306 estimates frequency responserevenue using the following equation:Rev(Reg _(award))=Reg _(award)(CP _(cap) +MR·CP _(perf))where CP_(cap), MR, and CP_(perf) are the energy market statisticsreceived from energy market predictor 414 and Reg_(award) is a functionof the midpoint b. For example, high level controller 306 may place abid that is as large as possible for a given midpoint, as shown in thefollowing equation:Reg _(award) =P _(limit) −|b|where P_(limit) is the power rating of power inverter 106.Advantageously, selecting Reg_(award) as a function of midpoint b allowshigh level controller 306 to predict the frequency response revenue thatwill result from a given midpoint b.

High level controller 306 may estimate the cost of battery degradationλ_(bat) as a function of the midpoints b. For example, high levelcontroller 306 may use a battery life model to predict a loss in batterycapacity that will result from a set of midpoints b, power outputs,and/or other variables that can be manipulated by controller 112. Insome embodiments, the battery life model expresses the loss in batterycapacity C_(loss,add) as a sum of multiple piecewise linear functions,as shown in the following equation:C _(loss,add) =f ₁(T _(cell))+f ₂(SOC)+f ₃(DOD)+f ₄(PR)+f ₅(ER)−C_(loss,nom)where T_(cell) is the cell temperature, SOC is the state-of-charge, DODis the depth of discharge, PR is the average power ratio

$\left( {{e.g.},{{PR} = {{avg}\left( \frac{P}{P_{des}} \right)}}} \right),$and ER is the average effort ratio (e.g.,

${ER} = {{avg}\left( \frac{\Delta\; P}{P_{des}} \right)}$of battery 108. Each of these terms is described in greater detail withreference to FIG. 4. Advantageously, several of the terms in the batterylife model depend on the midpoints b and power setpoints selected bycontroller 112. This allows high level controller 306 to predict a lossin battery capacity that will result from a given set of controloutputs. High level controller 306 may monetize the loss in batterycapacity and include the monetized cost of battery degradation λ_(bat)in the objective function J.

In some embodiments, high level controller 306 generates a set of filterparameters for low level controller 308. The filter parameters may beused by low level controller 308 as part of a low-pass filter thatremoves high frequency components from the regulation signal. In someembodiments, high level controller 306 generates a set of filterparameters that transform the regulation signal into an optimalfrequency response signal Res_(FR). For example, high level controller306 may perform a second optimization process to determine an optimalfrequency response Res_(FR) based on the optimized values forReg_(award) and midpoint b.

In some embodiments, high level controller 306 determines the optimalfrequency response Res_(FR) by optimizing value function J with thefrequency response revenue Rev(Reg_(award)) defined as follows:Rev(Reg _(award))=PS·Reg _(award)(CP _(cap) +MR·CP _(perf))and with the frequency response Res_(FR) substituted for the regulationsignal in the battery life model. The performance score PS may be basedon several factors that indicate how well the optimal frequency responseRes_(FR) tracks the regulation signal. Closely tracking the regulationsignal may result in higher performance scores, thereby increasing thefrequency response revenue. However, closely tracking the regulationsignal may also increase the cost of battery degradation λ_(bat). Theoptimized frequency response Res_(FR) represents an optimal tradeoffbetween decreased frequency response revenue and increased battery life.High level controller 306 may use the optimized frequency responseRes_(FR) to generate a set of filter parameters for low level controller308. These and other features of high level controller 306 are describedin greater detail with reference to FIG. 4.

Still referring to FIG. 3, low level controller 308 is shown receivingthe midpoints b and the filter parameters from high level controller306. Low level controller 308 may also receive the campus power signalfrom campus 102 and the regulation signal from incentive provider 114.Low level controller 308 may use the regulation signal to predict futurevalues of the regulation signal and may filter the predicted regulationsignal using the filter parameters provided by high level controller306.

Low level controller 308 may use the filtered regulation signal todetermine optimal power setpoints for power inverter 106. For example,low level controller 308 may use the filtered regulation signal tocalculate the desired interconnection power P*_(POI) using the followingequation:P* _(POI) =Reg _(award) ·Reg _(filter) +bwhere Reg_(filter) is the filtered regulation signal. Low levelcontroller 308 may subtract the campus power P_(campus) from the desiredinterconnection power P*_(POI) to calculate the optimal power setpointsP_(SP) for power inverter 106, as shown in the following equation:P _(SP) =P* _(POI) −P _(campus)

In some embodiments, low level controller 308 performs an optimizationto determine how closely to track P*_(POI). For example, low levelcontroller 308 may determine an optimal frequency response Res_(FR) byoptimizing value function J with the frequency response revenueRev(Reg_(award)) defined as follows:Rev(Reg _(award))=PS·Reg _(award)(CP _(cap) +MR·CP _(perf))and with the frequency response Res_(FR) substituted for the regulationsignal in the battery life model. Low level controller 308 may use theoptimal frequency response Res_(FR) in place of the filtered frequencyresponse Reg_(filter) to calculate the desired interconnection powerP*_(POI) and power setpoints P_(SP) as previously described. These andother features of low level controller 308 are described in greaterdetail with reference to FIG. 5.High Level Controller

Referring now to FIG. 4, a block diagram illustrating high levelcontroller 306 in greater detail is shown, according to an exemplaryembodiment. High level controller 306 is shown to include a processingcircuit 402. The processing circuit 402 is shown to include a processor404 and memory 406. Processor 404 may be a general purpose or specificpurpose processor, an application specific integrated circuit (ASIC),one or more field programmable gate arrays (FPGAs), a group ofprocessing components, or other suitable processing components.Processor 404 may be configured to execute computer code or instructionsstored in memory 406 or received from other computer readable media(e.g., CDROM, network storage, a remote server, etc.).

Memory 406 may include one or more devices (e.g., memory units, memorydevices, storage devices, etc.) for storing data and/or computer codefor completing and/or facilitating the various processes described inthe present disclosure. Memory 406 may include random access memory(RAM), read-only memory (ROM), hard drive storage, temporary storage,non-volatile memory, flash memory, optical memory, or any other suitablememory for storing software objects and/or computer instructions. Memory406 may include database components, object code components, scriptcomponents, or any other type of information structure for supportingthe various activities and information structures described in thepresent disclosure. Memory 406 may be communicably connected toprocessor 404 via processing circuit 402 and may include computer codefor executing (e.g., by processor 404) one or more processes describedherein.

High level controller 306 may further include a constant state-of-charge(SOC) controller 408 and a variable SOC controller 410. Constant SOCcontroller 408 may be configured to generate a midpoint b that resultsin battery 108 having the same SOC at the beginning and the end of eachfrequency response period. In other words, constant SOC controller 408may determine a midpoint b that maintains battery 108 at a predeterminedSOC at the beginning of each frequency response period. Variable SOCcontroller 410 may generate midpoint b using an optimization procedurethat allows the SOC of battery 108 to have different values at thebeginning and end of the frequency response period. In other words,variable SOC controller 410 may determine a midpoint b that results in anet change in the SOC of battery 108 over the duration of the frequencyresponse period.

Still referring to FIG. 4, high level controller 306 is shown to furtherinclude a load/rate predictor 412. Load/rate predictor 412 may beconfigured to predict the electric load of campus 102 (i.e., {circumflexover (P)}_(campus)) for each time step k (e.g., k=1 . . . n) within anoptimization window. Load/rate predictor 412 is shown receiving weatherforecasts from a weather service 322. In some embodiments, load/ratepredictor 412 predicts {circumflex over (P)}_(campus) as a function ofthe weather forecasts. In some embodiments, load/rate predictor 412 usesfeedback from campus 102 to predict {circumflex over (P)}_(campus).Feedback from campus 102 may include various types of sensory inputs(e.g., temperature, flow, humidity, enthalpy, etc.) or other datarelating to buildings 116, central plant 118, and/or energy generation120 (e.g., inputs from a HVAC system, a lighting control system, asecurity system, a water system, a PV energy system, etc.). Load/ratepredictor 412 may predict one or more different types of loads forcampus 102. For example, load/rate predictor 412 may predict a hot waterload, a cold water load, and/or an electric load for each time step kwithin the optimization window.

In some embodiments, load/rate predictor 412 receives a measuredelectric load and/or previous measured load data from campus 102. Forexample, load/rate predictor 412 may receive a campus power signal fromcampus 102. The campus power signal may indicate the measured electricload of campus 102. Load/rate predictor 412 may predict one or morestatistics of the campus power signal including, for example, a meancampus power μ_(campus) and a standard deviation of the campus power orσ_(campus). Load/rate predictor 412 may predict {circumflex over(P)}_(campus) as a function of a given weather forecast ({circumflexover (ϕ)}_(w)), a day type (day), the time of day (t), and previousmeasured load data (Y_(k-1)). Such a relationship is expressed in thefollowing equation:{circumflex over (P)} _(campus) =f({circumflex over (ϕ)}_(w) ,day,t|Y_(k-1))

In some embodiments, load/rate predictor 412 uses a deterministic plusstochastic model trained from historical load data to predict{circumflex over (P)}_(campus). Load/rate predictor 412 may use any of avariety of prediction methods to predict {circumflex over (P)}_(campus)(e.g., linear regression for the deterministic portion and an AR modelfor the stochastic portion). In some embodiments, load/rate predictor412 makes load/rate predictions using the techniques described in U.S.patent application Ser. No. 14/717,593, titled “Building ManagementSystem for Forecasting Time Series Values of Building Variables” andfiled May 20, 2015.

Load/rate predictor 412 may receive utility rates from utilities 320.Utility rates may indicate a cost or price per unit of a resource (e.g.,electricity, natural gas, water, etc.) provided by utilities 320 at eachtime step k in the optimization window. In some embodiments, the utilityrates are time-variable rates. For example, the price of electricity maybe higher at certain times of day or days of the week (e.g., during highdemand periods) and lower at other times of day or days of the week(e.g., during low demand periods). The utility rates may define varioustime periods and a cost per unit of a resource during each time period.Utility rates may be actual rates received from utilities 320 orpredicted utility rates estimated by load/rate predictor 412.

In some embodiments, the utility rates include demand charges for one ormore resources provided by utilities 320. A demand charge may define aseparate cost imposed by utilities 320 based on the maximum usage of aparticular resource (e.g., maximum energy consumption) during a demandcharge period. The utility rates may define various demand chargeperiods and one or more demand charges associated with each demandcharge period. In some instances, demand charge periods may overlappartially or completely with each other and/or with the predictionwindow. Advantageously, optimization controller 112 may be configured toaccount for demand charges in the high level optimization processperformed by high level controller 306. Utilities 320 may be defined bytime-variable (e.g., hourly) prices, a maximum service level (e.g., amaximum rate of consumption allowed by the physical infrastructure or bycontract) and, in the case of electricity, a demand charge or a chargefor the peak rate of consumption within a certain period. Load/ratepredictor 412 may store the predicted campus power {circumflex over(P)}_(campus) and the utility rates in memory 406 and/or provide thepredicted campus power {circumflex over (P)}_(campus) and the utilityrates to high level controller 306 as needed.

Still referring to FIG. 4, the high level controller 306 is shown toinclude an energy market predictor 414 and a signal statistics predictor416. Energy market predictor 414 may be configured to predict energymarket statistics relating to the frequency response program. Forexample, energy market predictor 414 may predict the values of one ormore variables that can be used to estimate frequency response revenue.In some embodiments, the frequency response revenue is defined by thefollowing equation:Rev=PS(CP _(cap) +MR·CP _(perf))Reg _(award)where Rev is the frequency response revenue, CP_(cap) is the capabilityclearing price, MR is the mileage ratio, and CP_(perf) is theperformance clearing price. PS is a performance score based on howclosely the frequency response provided by controller 112 tracks theregulation signal. Energy market predictor 414 may be configured topredict the capability clearing price CP_(cap), the performance clearingprice CP_(perf), the mileage ratio MR, and/or other energy marketstatistics that can be used to estimate frequency response revenue.Energy market predictor 414 may store the energy market statistics inmemory 406 and/or provide the energy market statistics to high levelcontroller 306.

Signal statistics predictor 416 may be configured to predict one or morestatistics of the regulation signal provided by incentive provider 114.For example, signal statistics predictor 416 may be configured topredict the mean μ_(FR), standard deviation σ_(FR), and/or otherstatistics of the regulation signal. The regulation signal statisticsmay be based on previous values of the regulation signal (e.g., ahistorical mean, a historical standard deviation, etc.) or predictedvalues of the regulation signal (e.g., a predicted mean, a predictedstandard deviation, etc.).

In some embodiments, signal statistics predictor 416 uses adeterministic plus stochastic model trained from historical regulationsignal data to predict future values of the regulation signal. Forexample, signal statistics predictor 416 may use linear regression topredict a deterministic portion of the regulation signal and an AR modelto predict a stochastic portion of the regulation signal. In someembodiments, signal statistics predictor 416 predicts the regulationsignal using the techniques described in U.S. patent application Ser.No. 14/717,593, titled “Building Management System for Forecasting TimeSeries Values of Building Variables” and filed May 20, 2015. Signalstatistics predictor 416 may use the predicted values of the regulationsignal to calculate the regulation signal statistics. Signal statisticspredictor 416 may store the regulation signal statistics in memory 406and/or provide the regulation signal statistics to high level controller306.

Constant State-of-Charge Controller

Constant SOC controller 408 may determine midpoint b by equating thedesired power P*_(POI) at POI 110 with the actual power at POI 110 asshown in the following equation:(Reg _(signal))(Reg _(award))+b=P _(bat) +P _(loss) +P _(campus)where the left side of the equation (Reg_(signal)) (Reg_(award))+b isthe desired power P*_(POI) at POI 110 and the right side of the equationis the actual power at POI 110. Integrating over the frequency responseperiod results in the following equation:

∫_(period)((Reg_(signal))(Reg_(award)) + b)dt = ∫_(period)(P_(bat) + P_(loss) + P_(campus))dt

Since the SOC of battery 108 is maintained at the same value at thebeginning and end of the frequency response period, the integral of thebattery power P_(bat) over the frequency response period is zero (i.e.,∫P_(bat)dt=0). Accordingly, the previous equation can be rewritten asfollows:

b = ∫_(period)P_(loss)dt + ∫_(period)P_(campus)dt − Reg_(award)∫_(period)Reg_(signal)dtwhere the term ∫P_(bat) dt has been omitted because ∫P_(bat) dt=0. Thisis ideal behavior if the only goal is to maximize frequency responserevenue. Keeping the SOC of battery 108 at a constant value (and near50%) will allow system 100 to participate in the frequency market duringall hours of the day.

Constant SOC controller 408 may use the estimated values of the campuspower signal received from campus 102 to predict the value of∫P_(campus) dt over the frequency response period. Similarly, constantSOC controller 408 may use the estimated values of the regulation signalfrom incentive provider 114 to predict the value of ∫Reg_(signal) dtover the frequency response period. Reg_(award) can be expressed as afunction of midpoint b as previously described (e.g.,Reg_(award)=P_(limit)−|b|). Therefore, the only remaining term in theequation for midpoint b is the expected battery power loss ∫P_(loss).

Constant SOC controller 408 is shown to include a battery power lossestimator 418. Battery power loss estimator 418 may estimate the valueof ∫P_(loss) dt using a Thevinin equivalent circuit model of battery108. For example, battery power loss estimator 418 may model battery 108as a voltage source in series with a resistor. The voltage source has anopen circuit voltage of V_(OC) and the resistor has a resistance ofR_(TH). An electric current I flows from the voltage source through theresistor.

To find the battery power loss in terms of the supplied power P_(sup),battery power loss estimator 418 may identify the supplied power P_(sup)as a function of the current I, the open circuit voltage V_(OC), and theresistance R_(TH) as shown in the following equation:P _(sup) =V _(OC) I−I ² R _(TH)which can be rewritten as:

${\frac{I^{2}}{I_{SC}} - I + \frac{P^{\prime}}{4}} = 0$with the following substitutions:

${I_{SC} = \frac{V_{OC}}{R_{TH}}},{P^{\prime} = \frac{P}{P_{\max}}},{P_{\max} = \frac{V_{OC}^{2}}{4R_{TH}}}$where P is the supplied power and P_(max) is the maximum possible powertransfer.

Battery power loss estimator 418 may solve for the current I as follows:

$I = {\frac{I_{SC}}{2}\left( {1 - \sqrt{1 - P^{\prime}}} \right)}$which can be converted into an expression for power loss P_(loss) interms of the supplied power P and the maximum possible power transferP_(max) as shown in the following equation:P _(loss) =P _(max)(1−√{square root over (1−P′)})²

Battery power loss estimator 418 may simplify the previous equation byapproximating the expression (1−√{square root over (1−P′)}) as a linearfunction about P′=0. This results in the following approximation forP_(loss):

$P_{loss} \approx {P_{\max}\left( \frac{P^{\prime}}{2} \right)}^{2}$which is a good approximation for powers up to one-fifth of the maximumpower.

Battery power loss estimator 418 may calculate the expected value of∫P_(loss) dt over the frequency response period as follows:

$\begin{matrix}{{\int_{period}{P_{loss}{dt}}} = {\int_{period}{{- {P_{\max}\left( \frac{{{Reg}_{award}{Reg}_{signal}} + b - P_{campus}}{2P_{\max}} \right)}^{2}}{dt}}}} \\{= {\frac{1}{4P_{\max}}\left\lbrack {{2{Reg}_{award}{\int_{period}{P_{campus}{Reg}_{signal}{dt}}}} -} \right.}} \\{{\int_{period}{P_{campus}^{2}{dt}}} -} \\{\left. {{Reg}_{award}^{2}{\int_{period}{{Reg}_{signal}^{2}{dt}}}} \right\rbrack +} \\{\frac{b}{2P_{\max}}\left\lbrack {{\int_{period}{P_{campus}^{2}{dt}}} -} \right.} \\{\left. {{Reg}_{award}{\int_{period}{{Reg}_{signal}{dt}}}} \right\rbrack - {\frac{b^{2}}{4P_{\max}}\Delta\; t}} \\{= {\frac{1}{4P_{\max}}\left\lbrack {{E\left\{ P_{campus}^{2} \right\}} + {{Reg}_{award}^{2}E\left\{ {Reg}_{signal}^{2} \right\}} -} \right.}} \\{{\left. {2{Reg}_{award}E\left\{ {Reg}_{signal} \right\} E\left\{ P_{campus} \right\}} \right\rbrack\Delta\; t} -} \\{{{\frac{b}{2P_{\max}}\left\lbrack {{{Reg}_{award}E\left\{ {Reg}_{signal} \right\}} - {E\left\{ P_{campus} \right\}}} \right\rbrack}\Delta\; t} -} \\{\frac{b^{2}}{4P_{\max}}\Delta\; t}\end{matrix}\quad$where the notation E{ } indicates that the variable within the brackets{ } is ergodic and can be approximated by the estimated mean of thevariable. This formulation allows battery power loss estimator 418 toestimate ∫P_(loss) dt as a function of other variables such asReg_(award), Reg_(signal), P_(campus), midpoint b, and P_(max).

Constant SOC controller 408 is shown to include a midpoint calculator420. Midpoint calculator 420 may be configured to calculate midpoint bby substituting the previous expression for ∫P_(loss) dt into theequation for midpoint b. After substituting known and estimated values,the equation for midpoint b can be rewritten as follows:

$\frac{1}{4P_{\max}}\left\lbrack {{E\left\{ P_{campus}^{2} \right\}} + {{Reg}_{award}^{2}E\left\{ {Reg}_{signal}^{2} \right\}} - {\quad{{\left. \quad{2{Reg}_{award}E\left\{ {Reg}_{signal} \right\} E\left\{ P_{campus} \right\}} \right\rbrack\Delta\; t} + {\quad{{{\left\lbrack {{{Reg}_{award}E\left\{ {Reg}_{signal} \right\}} - {E\left\{ P_{campus} \right\}}} \right\rbrack\Delta\; t} + {{\frac{b}{2P_{\max}}\left\lbrack {{{Reg}_{award}E\left\{ {Reg}_{signal} \right\}} - {E\left\{ P_{campus} \right\}}} \right\rbrack}\Delta\; t} + {b\;\Delta\; t} + {\frac{b^{2}}{4P_{\max}}\Delta\; t}} = 0}}}}} \right.$Midpoint calculator 420 may solve the equation for midpoint b todetermine the midpoint b that maintains battery 108 at a constantstate-of-charge.Variable State-of-Charge Controller

Variable SOC controller 410 may determine optimal midpoints b byallowing the SOC of battery 108 to have different values at thebeginning and end of a frequency response period. For embodiments inwhich the SOC of battery 108 is allowed to vary, the integral of thebattery power P_(bat) over the frequency response period can beexpressed as −ΔSOC·C_(des) as shown in the following equation:

∫_(period)P_(bat) dt = −Δ SOC ⋅ C_(des)where ΔSOC is the change in the SOC of battery 108 over the frequencyresponse period and C_(des) is the design capacity of battery 108. TheSOC of battery 108 may be a normalized variable (i.e., 0≤SOC≤1) suchthat the term SOC ·C_(des) represents the amount of energy stored inbattery 108 for a given state-of-charge. The SOC is shown as a negativevalue because drawing energy from battery 108 (i.e., a positive P_(bat))decreases the SOC of battery 108. The equation for midpoint b becomes:

$b = {{\int\limits_{period}{P_{loss}{dt}}} + {\int\limits_{period}{P_{campus}{dt}}} + {\int\limits_{period}{P_{bat}{dt}}} - {{Reg}_{award}{\int\limits_{period}{{Reg}_{signal}{dt}}}}}$

Variable SOC controller 410 is shown to include a battery power lossestimator 422 and a midpoint optimizer 424. Battery power loss estimator422 may be the same or similar to battery power loss estimator 418.Midpoint optimizer 424 may be configured to establish a relationshipbetween the midpoint b and the SOC of battery 108. For example, aftersubstituting known and estimated values, the equation for midpoint b canbe written as follows:

$\frac{1}{4P_{\max}}\left\lbrack {{E\left\{ P_{campus}^{2} \right\}} + {Reg}_{award}^{2} + {E\left\{ {Reg}_{signal}^{2} \right\}} - {\left. \quad{2{Reg}_{award}E\left\{ {Reg}_{signal} \right\} E\left\{ P_{campus} \right\}} \right\rbrack\Delta\; t} + {\quad{{\left\lbrack {{{Reg}_{award}E\left\{ {Reg}_{signal} \right\}} + {E\left\{ P_{campus} \right\}}} \right\rbrack\Delta\; t} + {\Delta\;{{SOC} \cdot C_{des}}} + {\quad{{{{\frac{b}{2P_{\max}}\left\lbrack {{{Reg}_{award}E\left\{ {Reg}_{signal} \right\}} - {E\left\{ P_{campus} \right\}}} \right\rbrack}\Delta\; t} + {b\;\Delta\; t} + {\frac{b^{2}}{4P_{\max}}\Delta\; t}} = 0}}}}} \right.$

Advantageously, the previous equation defines a relationship betweenmidpoint b and the change in SOC of battery 108. Midpoint optimizer 424may use this equation to determine the impact that different values ofmidpoint b have on the SOC in order to determine optimal midpoints b.This equation can also be used by midpoint optimizer 424 duringoptimization to translate constraints on the SOC in terms of midpoint b.For example, the SOC of battery 108 may be constrained between zero and1 (e.g., 0≤SOC≤1) since battery 108 cannot be charged in excess of itsmaximum capacity or depleted below zero. Midpoint optimizer 424 may usethe relationship between ΔSOC and midpoint b to constrain theoptimization of midpoint b to midpoint values that satisfy the capacityconstraint.

Midpoint optimizer 424 may perform an optimization to find optimalmidpoints b for each frequency response period within the optimizationwindow (e.g., each hour for the next day) given the electrical costsover the optimization window. Optimal midpoints b may be the midpointsthat maximize an objective function that includes both frequencyresponse revenue and costs of electricity and battery degradation. Forexample, an objective function J can be written as:

$J = {{\sum\limits_{k = 1}^{h}{{Rev}\left( {Reg}_{{award},k} \right)}} + {\sum\limits_{k = 1}^{h}{c_{k}b_{k}}} + {\min\limits_{period}\left( {P_{{campus},k} + b_{k}} \right)} - {\sum\limits_{k = 1}^{h}\lambda_{{bat},k}}}$where Rev(Reg_(award,k)) is the frequency response revenue at time stepk, c_(k)b_(k) is the cost of electricity purchased at time step k, themin( ) term is the demand charge based on the maximum rate ofelectricity consumption during the applicable demand charge period, andλ_(bat,k) is the monetized cost battery degradation at time step k.Midpoint optimizer 424 may use input from frequency response revenueestimator 428 (e.g., a revenue model) to determine a relationshipbetween midpoint b and Rev(Reg_(award,k)). Similarly, midpoint optimizer424 may use input from battery degradation estimator 430 and/or revenueloss estimator 432 to determine a relationship between midpoint b andthe monetized cost of battery degradation λ_(bat,k).

Still referring to FIG. 4, variable SOC controller 410 is shown toinclude an optimization constraints module 426. Optimization constraintsmodule 426 may provide one or more constraints on the optimizationperformed by midpoint optimizer 424. The optimization constraints may bespecified in terms of midpoint b or other variables that are related tomidpoint b. For example, optimization constraints module 426 mayimplement an optimization constraint specifying that the expected SOC ofbattery 108 at the end of each frequency response period is between zeroand one, as shown in the following equation:

${0 \leq {{SOC}_{0} + {\sum\limits_{i = 1}^{j}{\Delta\;{SOC}_{i}}}} \leq {1\mspace{11mu}{\forall\mspace{11mu} j}}} = {1\;\ldots\; h}$where SOC₀ is the SOC of battery 108 at the beginning of theoptimization window, ΔSOC_(i) is the change in SOC during frequencyresponse period i, and h is the total number of frequency responseperiods within the optimization window.

In some embodiments, optimization constraints module 426 implements anoptimization constraint on midpoint b so that the power at POI 110 doesnot exceed the power rating of power inverter 106. Such a constraint isshown in the following equation:−P _(limit) ≤b _(k) +P _(campus,max) ^((p)) ≤P _(limit)where P_(limit) is the power rating of power inverter 106 andP_(campus,max) ^((p)) is the maximum value of P_(campus) at confidencelevel p. This constraint could also be implemented by identifying theprobability that the sum of b_(k) and P_(campus,max) exceeds the powerinverter power rating (e.g., using a probability density function forP_(campus,max)) and limiting that probability to less than or equal to1−p.

In some embodiments, optimization constraints module 426 implements anoptimization constraint to ensure (with a given probability) that theactual SOC of battery 108 remains between zero and one at each time stepduring the applicable frequency response period. This constraint isdifferent from the first optimization constraint which placed bounds onthe expected SOC of battery 108 at the end of each optimization period.The expected SOC of battery 108 can be determined deterministically,whereas the actual SOC of battery 108 is dependent on the campus powerP_(campus) and the actual value of the regulation signal Reg_(signal) ateach time step during the optimization period. In other words, for anyvalue of Reg_(award)>0, there is a chance that battery 108 becomes fullydepleted or fully charged while maintaining the desired power P*_(POI)at POI 110.

Optimization constraints module 426 may implement the constraint on theactual SOC of battery 108 by approximating the battery power P_(bat) (arandom process) as a wide-sense stationary, correlated normallydistributed process. Thus, the SOC of battery 108 can be considered as arandom walk. Determining if the SOC would violate the constraint is anexample of a gambler's ruin problem. For example, consider a random walkdescribed by the following equation:y _(k+1) =y _(k) +x _(k) , P(x _(k)=1)=p, P(x _(k)=−1)=1−pThe probability P that y_(k) (starting at state z) will reach zero inless than n moves is given by the following equation:

$P = {2{{a^{- 1}\left( {2p} \right)}^{\frac{n - z}{2}}\left\lbrack {2\left( {1 - p} \right)} \right\rbrack}^{\frac{n + z}{2}}{\sum\limits_{v = 1}^{\frac{a}{2}}{{\cos^{n - 1}\left( \frac{\pi\; v}{a} \right)}{\sin\left( \frac{\pi\; v}{a} \right)}{\sin\left( \frac{\pi\;{zv}}{a} \right)}}}}$In some embodiments, each frequency response period includesapproximately n=1800 time steps (e.g., one time step every two secondsfor an hour). Therefore, the central limit theorem applies and it ispossible to convert the autocorrelated random process for P_(bat) andthe limits on the SOC of battery 108 into an uncorrelated random processof 1 or −1 with a limit of zero.

In some embodiments, optimization constraints module 426 converts thebattery power P_(bat) into an uncorrelated normal process driven by theregulation signal Reg_(signal). For example, consider the originalbattery power described by the following equation:x _(k+1) =αx _(k) +e _(k) , x _(k) ˜N(μ,σ), e _(k) ˜N(μ_(e),σ_(e))where the signal x represents the battery power P_(bat), α is anautocorrelation parameter, and e is a driving signal. In someembodiments, e represents the regulation signal Reg_(signal). If thepower of the signal x is known, then the power of signal e is alsoknown, as shown in the following equations:μ(1−α)=μ_(e)E{x _(k) ²}(1−α)²−2αμμ_(e) =E{e _(k) ²}E{x _(k) ²}(1−α²)−2μ²α(1−α)=E{e _(k) ²},Additionally, the impulse response of the difference equation forx_(k+1) is:h_(k)=α^(k) k≥0Using convolution, x_(k) can be expressed as follows:

$x_{k} = {\sum\limits_{i = 1}^{k}{\alpha^{k - i}e_{i - 1}}}$x₃ = α²e₀ + α¹e₁ + e₂x_(q) = α^(q − 1)e₀ + α^(q − 2)e₁ + …  + α e_(q − 2) + e_(q − 1)

A random walk driven by signal x_(k) can be defined as follows:

$y_{k} = {{\sum\limits_{j = 1}^{k}x_{j}} = {\sum\limits_{j = 1}^{k}{\sum\limits_{i = 1}^{j}{\alpha^{j - 1}e_{i - 1}}}}}$which for large values of j can be approximated using the infinite sumof a geometric series in terms of the uncorrelated signal e rather thanx:

$y_{k} = {{{\sum\limits_{j = 1}^{k}x_{j}} \approx {\sum\limits_{j = 1}^{k}{\frac{1}{1 - \alpha}e_{j}}}} = {{\sum\limits_{j = 1}^{k}{x_{j}^{\prime}\mspace{20mu} k}} ⪢ 1}}$Thus, the autocorrelated driving signal x_(k) of the random walk can beconverted into an uncorrelated driving signal x′_(k) with mean and powergiven by:

${{E\left\{ x_{k}^{\prime} \right\}} = \mu},{{E\left\{ \left( {x_{k}^{\prime} - \mu} \right)^{2} \right\}} = {\frac{1 + \alpha}{1 - \alpha}\sigma^{2}}},{{E\left\{ x_{k}^{\prime\; 2} \right\}} = {{\frac{1 + \alpha}{1 - \alpha}\sigma^{2}} + \mu^{2}}},{\sigma_{x^{\prime}}^{2} = {\frac{1 + \alpha}{1 - \alpha}\sigma^{2}}}$where x′_(k) represents the regulation signal Reg_(signal).Advantageously, this allows optimization constraints module 426 todefine the probability of ruin in terms of the regulation signalReg_(signal).

In some embodiments, optimization constraints module 426 determines aprobability p that the random walk driven by the sequence of −1 and 1will take the value of 1. In order to ensure that the random walk drivenby the sequence of −1 and 1 will behave the same as the random walkdriven by x′_(k), optimization constraints module 426 may select p suchthat the ratio of the mean to the standard deviation is the same forboth driving functions, as shown in the following equations:

$\frac{mean}{stdev} = {\frac{\mu}{\sqrt{\frac{1 + \alpha}{1 - \alpha}\sigma}} = {\overset{\sim}{\mu} = \frac{{2p} - 1}{\sqrt{4{p\left( {1 - p} \right)}}}}}$$p = {\frac{1}{2} \pm {\frac{1}{2}\sqrt{1 - \left( \frac{1}{{\overset{\sim}{\mu}}^{2} + 1} \right)}}}$where {tilde over (μ)} is the ratio of the mean to the standarddeviation of the driving signal (e.g., Reg_(signal)) and μ is the changein state-of-charge over the frequency response period divided by thenumber of time steps within the frequency response period

$\left( {{i.e.},{\mu = \frac{\Delta\;{SOC}}{n}}} \right).$For embodiments in which each frequency response period has a durationof one hour (i.e., 3600 seconds) and the interval between time steps istwo seconds, the number of time steps per frequency response period is1800 (i.e., n=1800). In the equation for p, the plus is used when {tildeover (μ)} is greater than zero, whereas the minus is used when {tildeover (μ)} is less than zero. Optimization constraints module 426 mayalso ensure that both driving functions have the same number of standarddeviations away from zero (or ruin) to ensure that both random walkshave the same behavior, as shown in the following equation:

$z = \frac{{{SOC} \cdot C_{des}}\sqrt{4{p\left( {1 - p} \right)}}}{\sqrt{\frac{1 + \alpha}{1 - \alpha}\sigma}}$

Advantageously, the equations for p and z allow optimization constraintsmodule 426 to define the probability of ruin P (i.e., the probability ofbattery 108 fully depleting or reaching a fully charged state) within Ntime steps (n=1 . . . N) as a function of variables that are known tohigh level controller 306 and/or manipulated by high level controller306. For example, the equation for p defines p as a function of the meanand standard deviation of the regulation signal Reg_(signal), which maybe estimated by signal statistics predictor 416. The equation for zdefines z as a function of the SOC of battery 108 and the parameters ofthe regulation signal Reg_(signal).

Optimization constraints module 426 may use one or more of the previousequations to place constraints on ΔSOC ·C_(des) and Reg_(award) giventhe current SOC of battery 108. For example, optimization constraintsmodule 426 may use the mean and standard deviation of the regulationsignal Reg_(signal) to calculate p. Optimization constraints module 426may then use p in combination with the SOC of battery 108 to calculatez. Optimization constraints module 426 may use p and z as inputs to theequation for the probability of ruin P. This allows optimizationconstraints module 426 to define the probability or ruin P as a functionof the SOC of battery 108 and the estimated statistics of the regulationsignal Reg_(signal). Optimization constraints module 426 may imposeconstraints on the SOC of battery 108 to ensure that the probability ofruin P within N time steps does not exceed a threshold value. Theseconstraints may be expressed as limitations on the variables ΔSOC·C_(des) and/or Reg_(award), which are related to midpoint b aspreviously described.

In some embodiments, optimization constraints module 426 uses theequation for the probability of ruin P to define boundaries on thecombination of variables p and z. The boundaries represent thresholdswhen the probability of ruin P in less than N steps is greater than acritical value P_(cr) (e.g., P_(cr)=0.001). For example, optimizationconstraints module 426 may generate boundaries that correspond to athreshold probability of battery 108 fully depleting or reaching a fullycharged state during a frequency response period (e.g., in N=1800steps).

In some embodiments, optimization constraints module 426 constrains theprobability of ruin P to less than the threshold value, which imposeslimits on potential combinations of the variables p and z. Since thevariables p and z are related to the SOC of battery 108 and thestatistics of the regulation signal, the constraints may imposelimitations on ΔSOC ·C_(des) and Reg_(award) given the current SOC ofbattery 108. These constraints may also impose limitations on midpoint bsince the variables ΔSOC ·C_(des) and Reg_(award) are related tomidpoint b. For example, optimization constraints module 426 may setconstraints on the maximum bid Reg_(award) given a desired change in theSOC for battery 108. In other embodiments, optimization constraintsmodule 426 penalizes the objective function J given the bid Reg_(award)and the change in SOC.

Still referring to FIG. 4, variable SOC controller 410 is shown toinclude a frequency response (FR) revenue estimator 428. FR revenueestimator 428 may be configured to estimate the frequency responserevenue that will result from a given midpoint b (e.g., a midpointprovided by midpoint optimizer 424). The estimated frequency responserevenue may be used as the term Rev(Reg_(award,k)) in the objectivefunction J. Midpoint optimizer 424 may use the estimated frequencyresponse revenue along with other terms in the objective function J todetermine an optimal midpoint b.

In some embodiments, FR revenue estimator 428 uses a revenue model topredict frequency response revenue. An exemplary revenue model which maybe used by FR revenue estimator 428 is shown in the following equation:Rev(Reg _(award))=Reg _(award)(CP _(cap) +MR·CP _(perf))where CP_(cap), MR, and CP_(perf) are the energy market statisticsreceived from energy market predictor 414 and Reg_(award) is a functionof the midpoint b. For example, capability bid calculator 434 maycalculate Reg_(award) using the following equation:Reg _(award) =P _(limit) −|b|where P_(limit) is the power rating of power inverter 106.

As shown above, the equation for frequency response revenue used by FRrevenue estimator 428 does not include a performance score (or assumes aperformance score of 1.0). This results in FR revenue estimator 428estimating a maximum possible frequency response revenue that can beachieved for a given midpoint b (i.e., if the actual frequency responseof controller 112 were to follow the regulation signal exactly).However, it is contemplated that the actual frequency response may beadjusted by low level controller 308 in order to preserve the life ofbattery 108. When the actual frequency response differs from theregulation signal, the equation for frequency response revenue can beadjusted to include a performance score. The resulting value function Jmay then be optimized by low level controller 308 to determine anoptimal frequency response output which considers both frequencyresponse revenue and the costs of battery degradation, as described withreference to FIG. 5.

Still referring to FIG. 4, variable SOC controller 410 is shown toinclude a battery degradation estimator 430. Battery degradationestimator 430 may estimate the cost of battery degradation that willresult from a given midpoint b (e.g., a midpoint provided by midpointoptimizer 424). The estimated battery degradation may be used as theterm λ_(bat) in the objective function J. Midpoint optimizer 424 may usethe estimated battery degradation along with other terms in theobjective function J to determine an optimal midpoint b.

In some embodiments, battery degradation estimator 430 uses a batterylife model to predict a loss in battery capacity that will result from aset of midpoints b, power outputs, and/or other variables that can bemanipulated by high level controller 306. The battery life model maydefine the loss in battery capacity C_(loss,add) as a sum of multiplepiecewise linear functions, as shown in the following equation:C _(loss,add) =f ₁(T _(cell))+f ₂(SOC)+f ₃(DOD)+f ₄(PR)+f ₅(ER)−C_(loss,nom)where T_(cell) is the cell temperature, SOC is the state-of-charge, DODis the depth of discharge, PR is the average power ratio

$\left( {{e.g.},{{PR} = {{avg}\left( \frac{P_{avg}}{P_{des}} \right)}}} \right),$and ER is the average effort ratio (e.g.,

${ER} = {{avg}\left( \frac{\Delta\; P_{bat}}{P_{des}} \right)}$of battery 108. C_(loss,nom) is the nominal loss in battery capacitythat is expected to occur over time. Therefore, C_(loss,add) representsthe additional loss in battery capacity degradation in excess of thenominal value C_(loss,nom).

Battery degradation estimator 430 may define the terms in the batterylife model as functions of one or more variables that have known values(e.g., estimated or measured values) and/or variables that can bemanipulated by high level controller 306. For example, batterydegradation estimator 430 may define the terms in the battery life modelas functions of the regulation signal statistics (e.g., the mean andstandard deviation of Reg_(signal)), the campus power signal statistics(e.g., the mean and standard deviation of P_(campus)), Reg_(award),midpoint b, the SOC of battery 108, and/or other variables that haveknown or controlled values.

In some embodiments, battery degradation estimator 430 measures the celltemperature T_(cell) using a temperature sensor configured to measurethe temperature of battery 108. In other embodiments, batterydegradation estimator 430 estimates or predicts the cell temperatureT_(cell) based on a history of measured temperature values. For example,battery degradation estimator 430 may use a predictive model to estimatethe cell temperature T_(cell) as a function of the battery powerP_(bat), the ambient temperature, and/or other variables that can bemeasured, estimated, or controlled by high level controller 306.

Battery degradation estimator 430 may define the variable SOC in thebattery life model as the SOC of battery 108 at the end of the frequencyresponse period. The SOC of battery 108 may be measured or estimatedbased on the control decisions made by high level controller 306. Forexample, battery degradation estimator 430 may use a predictive model toestimate or predict the SOC of battery 108 at the end of the frequencyresponse period as a function of the battery power P_(bat), the midpointb, and/or other variables that can be measured, estimated, or controlledby high level controller 306.

Battery degradation estimator 430 may define the average power ratio PRas the ratio of the average power output of battery 108 (i.e., P_(avg))to the design power P_(des)

$\left( {{e.g.},{{PR} = \frac{P_{avg}}{P_{des}}}} \right).$The average power output of battery 108 can be defined using thefollowing equation:P _(avg) =E{|Reg _(award) Reg _(signal) +b−P _(loss) −P _(campus)|}where the expression (Reg_(award)Reg_(signal)+b−P_(loss)−P_(campus))represents the battery power P_(bat). The expected value of P_(avg) isgiven by:

$P_{avg} = {{\sigma_{bat}\sqrt{\frac{2}{\pi}}{\exp\left( \frac{- \mu_{bat}^{2}}{2\sigma_{bat}^{2}} \right)}} + {{erf}\left( \frac{- \mu_{bat}}{\sqrt{2\sigma_{bat}^{2}}} \right)}}$where μ_(bat) and σ_(bat) ² are the mean and variance of the batterypower P_(bat). The variables μ_(bat) and σ_(bat) ² may be defined asfollows:μ_(bat) =Reg _(award) E{Reg _(signal) }+b−E{P _(loss) }−E{P _(campus)}σ_(bat) ² =Reg _(award) ²σ_(FR) ²+σ_(campus) ²where σ_(FR) ² is the variance of Reg_(signal) and the contribution ofthe battery power loss to the variance σ_(bat) ² is neglected.

Battery degradation estimator 430 may define the average effort ratio ERas the ratio of the average change in battery power ΔP_(avg) to thedesign power P_(des)

$\left( {{i.e.},{{ER} = \frac{\Delta\; P_{avg}}{P_{des}}}} \right).$The average change in battery power can be defined using the followingequation:ΔP _(avg) =E{P _(bat,k) −P _(bat,k-1)}ΔP _(avg) =E{|Reg _(award)(Reg _(signal,k) −Reg _(signal,k-1))−(P_(loss,k) −P _(loss,k-1))−(P _(campus,k) −P _(campus,k-1))|}To make this calculation more tractable, the contribution due to thebattery power loss can be neglected. Additionally, the campus powerP_(campus) and the regulation signal Reg_(signal) can be assumed to beuncorrelated, but autocorrelated with first order autocorrelationparameters of α_(campus) and α, respectively. The argument inside theabsolute value in the equation for ΔP_(avg) has a mean of zero and avariance given by:

$\begin{matrix}{\sigma_{diff}^{2} = {E\left\{ \left\lbrack {{{Reg}_{award}\left( {{Reg}_{{signal},k} - {Reg}_{{signal},{k - 1}}} \right)} - \left( {P_{{campus},k} - P_{{campus},{k - 1}}} \right)} \right\rbrack^{2} \right\}}} \\{= {E\left\{ \left\lbrack {{{Reg}_{award}^{2}\left( {{Reg}_{{signal},k} - {Reg}_{{signal},{k - 1}}} \right)}^{2} - \left( {P_{{campus},k} - P_{{campus},{k - 1}}} \right)^{2}} \right\} \right.}} \\{= {{2{{Reg}_{award}^{2}\left( {1 - \alpha} \right)}\sigma_{FR}^{2}} + {2\left( {1 - \alpha_{campus}} \right)\sigma_{campus}^{2}}}}\end{matrix}$

Battery degradation estimator 430 may define the depth of discharge DODas the maximum state-of-charge minus the minimum state-of-charge ofbattery 108 over the frequency response period, as shown in thefollowing equation:DOD=SOC _(max) −SOC _(min)The SOC of battery 108 can be viewed as a constant slope with a zeromean random walk added to it, as previously described. An uncorrelatednormal random walk with a driving signal that has zero mean has anexpected range given by:

${E\left\{ {\max - \min} \right\}} = {2\sigma\sqrt{\frac{2N}{\pi}}}$where E{max−min} represent the depth of discharge DOD and can beadjusted for the autocorrelation of the driving signal as follows:

${E\left\{ {\max - \min} \right\}} = {2\sigma_{bat}\sqrt{\frac{1 + \alpha_{bat}}{1 - \alpha_{bat}}}\sqrt{\frac{2N}{\pi}}}$σ_(bat)² = Reg_(award)²σ_(FR)² + σ_(campus)²$\alpha_{bat} = \frac{{{Reg}_{award}^{2}\alpha\;\sigma_{FR}^{2}} + {\alpha_{campus}\sigma_{campus}^{2}}}{{{Reg}_{award}^{2}\sigma_{FR}^{2}} + \sigma_{campus}^{2}}$

If the SOC of battery 108 is expected to change (i.e., is not zeromean), the following equation may be used to define the depth ofdischarge:

${E\left\{ {\max - \min} \right\}} = \left\{ \begin{matrix}{R_{0} + {{c \cdot \Delta}\;{{SOC} \cdot \exp}\left\{ {{- \alpha}\frac{R_{0} - {\Delta\;{SOC}}}{\sigma_{bat}}} \right\}}} & {{\Delta\;{SOC}} < R_{0}} \\{{\Delta\;{SOC}} + {{c \cdot R_{0} \cdot \exp}\left\{ {{- \alpha}\frac{{\Delta\;{SOC}} - R_{0}}{\sigma_{bat}}} \right\}}} & {{\Delta\;{SOC}} > R_{0}}\end{matrix} \right.$where R₀ is the expected range with zero expected change in thestate-of-charge. Battery degradation estimator 430 may use the previousequations to establish a relationship between the capacity lossC_(loss,add) and the control outputs provided by high level controller306.

Still referring to FIG. 4, variable SOC controller 410 is shown toinclude a revenue loss estimator 432. Revenue loss estimator 432 may beconfigured to estimate an amount of potential revenue that will be lostas a result of the battery capacity loss C_(loss,add). In someembodiments, revenue loss estimator 432 converts battery capacity lossC_(loss,add) into lost revenue using the following equation:R _(loss)=(CP _(cap) +MR·CP _(perf))C _(loss,add) P _(des)where R_(loss) is the lost revenue over the duration of the frequencyresponse period.

Revenue loss estimator 432 may determine a present value of the revenueloss R_(loss) using the following equation:

$\lambda_{bat} = {\left\lbrack \frac{1 - \left( {1 + \frac{i}{n}} \right)^{- n}}{\frac{i}{n}} \right\rbrack R_{loss}}$where n is the total number of frequency response periods (e.g., hours)during which the revenue loss occurs and λ_(bat) is the present value ofthe revenue loss during the ith frequency response period. In someembodiments, the revenue loss occurs over ten years (e.g., n=87,600hours). Revenue loss estimator 432 may provide the present value of therevenue loss λ_(bat) to midpoint optimizer 424 for use in the objectivefunction J.

Midpoint optimizer 424 may use the inputs from optimization constraintsmodule 426, FR revenue estimator 428, battery degradation estimator 430,and revenue loss estimator 432 to define the terms in objective functionJ. Midpoint optimizer 424 may determine values for midpoint b thatoptimize objective function J. In various embodiments, midpointoptimizer 424 may use sequential quadratic programming, dynamicprogramming, or any other optimization technique.

Still referring to FIG. 4, high level controller 306 is shown to includea capability bid calculator 434. Capability bid calculator 434 may beconfigured to generate a capability bid Reg_(award) based on themidpoint b generated by constant SOC controller 408 and/or variable SOCcontroller 410. In some embodiments, capability bid calculator 434generates a capability bid that is as large as possible for a givenmidpoint, as shown in the following equation:Reg _(award) =P _(limit) −|b|where P_(limit) is the power rating of power inverter 106. Capabilitybid calculator 434 may provide the capability bid to incentive provider114 and to frequency response optimizer 436 for use in generating anoptimal frequency response.Filter Parameters Optimization

Still referring to FIG. 4, high level controller 306 is shown to includea frequency response optimizer 436 and a filter parameters optimizer438. Filter parameters optimizer 438 may be configured to generate a setof filter parameters for low level controller 308. The filter parametersmay be used by low level controller 308 as part of a low-pass filterthat removes high frequency components from the regulation signalReg_(signal). In some embodiments, filter parameters optimizer 438generates a set of filter parameters that transform the regulationsignal Reg_(signal) into an optimal frequency response signal Res_(FR).Frequency response optimizer 436 may perform a second optimizationprocess to determine the optimal frequency response Res_(FR) based onthe values for Reg_(award) and midpoint b. In the second optimization,the values for Reg_(award) and midpoint b may be fixed at the valuespreviously determined during the first optimization.

In some embodiments, frequency response optimizer 436 determines theoptimal frequency response Res_(FR) by optimizing value function J shownin the following equation:

$J = {{\sum\limits_{k = 1}^{h}{{Rev}\left( {Reg}_{{award},k} \right)}} + {\sum\limits_{k = 1}^{h}{c_{k}b_{k}}} + {\min\limits_{period}\left( {P_{{campus},k} + b_{k}} \right)} - {\sum\limits_{k = 1}^{h}\lambda_{{bat},k}}}$where the frequency response revenue Rev(Reg_(award)) is defined asfollows:Rev(Reg _(award))=PS·Reg _(award)(CP _(cap) +MR·CP _(perf))and the frequency response Res_(FR) is substituted for the regulationsignal Reg_(signal) in the battery life model used to calculateλ_(bat,k). The performance score PS may be based on several factors thatindicate how well the optimal frequency response Res_(FR) tracks theregulation signal Reg_(signal).

The frequency response Res_(FR) may affect both Rev(Reg_(award)) and themonetized cost of battery degradation λ_(bat). Closely tracking theregulation signal may result in higher performance scores, therebyincreasing the frequency response revenue. However, closely tracking theregulation signal may also increase the cost of battery degradationλ_(bat). The optimized frequency response Res_(FR) represents an optimaltradeoff between decreased frequency response revenue and increasedbattery life (i.e., the frequency response that maximizes value J).

In some embodiments, the performance score PS is a composite weightingof an accuracy score, a delay score, and a precision score. Frequencyresponse optimizer 436 may calculate the performance score PS using theperformance score model shown in the following equation:PS=⅓PS _(acc)+⅓PS _(delay)+⅓PS _(prec)where PS_(acc) is the accuracy score, PS_(delay) is the delay score, andPS_(prec) is the precision score. In some embodiments, each term in theprecision score is assigned an equal weighting (e.g., ⅓). In otherembodiments, some terms may be weighted higher than others.

The accuracy score PS_(acc) may be the maximum correlation between theregulation signal Re and the optimal frequency response Res_(FR).Frequency response optimizer 436 may calculate the accuracy scorePS_(acc) using the following equation:

${PS}_{acc} = {\max\limits_{\delta}\; r_{{Reg},{{Res}{(\delta)}}}}$where δ is a time delay between zero and δ_(max) (e.g., between zero andfive minutes).

The delay score PS_(delay) may be based on the time delay δ between theregulation signal Reg_(signal) and the optimal frequency responseRes_(FR). Frequency response optimizer 436 may calculate the delay scorePS_(delay) using the following equation:

${PS}_{delay} = {\frac{{\delta\lbrack s\rbrack} - \delta_{\max}}{\delta_{\max}}}$where δ[s] is the time delay of the frequency response Res_(FR) relativeto the regulation signal Reg_(signal) and δ_(max) is the maximumallowable delay (e.g., 5 minutes or 300 seconds).

The precision score PS_(prec) may be based on a difference between thefrequency response Res_(FR) and the regulation signal Reg_(signal).Frequency response optimizer 436 may calculate the precision scorePS_(prec) using the following equation:

${PS}_{prec} = {1 - \frac{\sum{{{Res}_{FR} - {Reg}_{signal}}}}{\sum{{Reg}_{signal}}}}$

Frequency response optimizer 436 may use the estimated performance scoreand the estimated battery degradation to define the terms in objectivefunction J. Frequency response optimizer 436 may determine values forfrequency response Res_(FR) that optimize objective function J. Invarious embodiments, frequency response optimizer 436 may use sequentialquadratic programming, dynamic programming, or any other optimizationtechnique.

Filter parameters optimizer 438 may use the optimized frequency responseRes_(FR) to generate a set of filter parameters for low level controller308. In some embodiments, the filter parameters are used by low levelcontroller 308 to translate an incoming regulation signal into afrequency response signal. Low level controller 308 is described ingreater detail with reference to FIG. 5.

Low Level Controller

Referring now to FIG. 5, a block diagram illustrating low levelcontroller 308 in greater detail is shown, according to an exemplaryembodiment. Low level controller 308 may receive the midpoints b and thefilter parameters from high level controller 306. Low level controller308 may also receive the campus power signal from campus 102 and theregulation signal Reg_(signal) and the regulation award Reg_(award) fromincentive provider 114. Low level controller 308 is shown to include aprocessing circuit 502. The processing circuit 502 is shown to include aprocessor 504 and memory 506. Processor 504 may be a general purpose orspecific purpose processor, an application specific integrated circuit(ASIC), one or more field programmable gate arrays (FPGAs), a group ofprocessing components, or other suitable processing components.Processor 404 may be configured to execute computer code or instructionsstored in memory 506 or received from other computer readable media(e.g., CDROM, network storage, a remote server, etc.).

Memory 506 may include one or more devices (e.g., memory units, memorydevices, storage devices, etc.) for storing data and/or computer codefor completing and/or facilitating the various processes described inthe present disclosure. Memory 506 may include random access memory(RAM), read-only memory (ROM), hard drive storage, temporary storage,non-volatile memory, flash memory, optical memory, or any other suitablememory for storing software objects and/or computer instructions. Memory506 may include database components, object code components, scriptcomponents, or any other type of information structure for supportingthe various activities and information structures described in thepresent disclosure. Memory 506 may be communicably connected toprocessor 504 via processing circuit 502 and may include computer codefor executing (e.g., by processor 504) one or more processes describedherein.

Predicting and Filtering the Regulation Signal

Low level controller 308 is shown to include a regulation signalpredictor 508. Regulation signal predictor 508 may use a history of pastand current values for the regulation signal Reg_(signal) to predictfuture values of the regulation signal. In some embodiments, regulationsignal predictor 508 uses a deterministic plus stochastic model trainedfrom historical regulation signal data to predict future values of theregulation signal Reg_(signal). For example, regulation signal predictor508 may use linear regression to predict a deterministic portion of theregulation signal Reg_(signal) and an AR model to predict a stochasticportion of the regulation signal Reg_(signal). In some embodiments,regulation signal predictor 508 predicts the regulation signalReg_(signal) using the techniques described in U.S. patent applicationSer. No. 14/717,593, titled “Building Management System for ForecastingTime Series Values of Building Variables” and filed May 20, 2015.

Low level controller 308 is shown to include a regulation signal filter510. Regulation signal filter 510 may filter the incoming regulationsignal Reg_(signal) and/or the predicted regulation signal using thefilter parameters provided by high level controller 306. In someembodiments, regulation signal filter 510 is a low pass filterconfigured to remove high frequency components from the regulationsignal Reg_(signal). Regulation signal filter 510 may provide thefiltered regulation signal to power setpoint optimizer 512.

Determining Optimal Power Setpoints

Power setpoint optimizer 512 may be configured to determine optimalpower setpoints for power inverter 106 based on the filtered regulationsignal. In some embodiments, power setpoint optimizer 512 uses thefiltered regulation signal as the optimal frequency response. Forexample, low level controller 308 may use the filtered regulation signalto calculate the desired interconnection power P*_(POI) using thefollowing equation:P* _(POI) =Reg _(award) ·Reg _(filter) +bwhere Reg_(filter) is the filtered regulation signal. Power setpointoptimizer 512 may subtract the campus power P_(campus) from the desiredinterconnection power P*_(POI) to calculate the optimal power setpointsP_(SP) for power inverter 106, as shown in the following equation:P _(SP) =P* _(POI) −P _(campus)

In other embodiments, low level controller 308 performs an optimizationto determine how closely to track P*_(POI). For example, low levelcontroller 308 is shown to include a frequency response optimizer 514.Frequency response optimizer 514 may determine an optimal frequencyresponse Res_(FR) by optimizing value function J shown in the followingequation:

$J = {{\sum\limits_{k = 1}^{h}{{Rev}\left( {Reg}_{{award},k} \right)}} + {\sum\limits_{k = 1}^{h}{c_{k}b_{k}}} + {\min\limits_{period}\left( {P_{{campus},k} + b_{k}} \right)} - {\sum\limits_{k = 1}^{h}\lambda_{{bat},k}}}$where the frequency response Res_(FR) affects both Rev(Reg_(award)) andthe monetized cost of battery degradation λ_(bat). The frequencyresponse Res_(FR) may affect both Rev(Reg_(award)) and the monetizedcost of battery degradation λ_(bat). The optimized frequency responseRes_(FR) represents an optimal tradeoff between decreased frequencyresponse revenue and increased battery life (i.e., the frequencyresponse that maximizes value J). The values of Rev(Reg_(award)) andλ_(bat,k) may be calculated by FR revenue estimator 516, performancescore calculator 518, battery degradation estimator 520, and revenueloss estimator 522.Estimating Frequency Response Revenue

Still referring to FIG. 5, low level controller 308 is shown to includea FR revenue estimator 516. FR revenue estimator 516 may estimate afrequency response revenue that will result from the frequency responseRes_(FR). In some embodiments, FR revenue estimator 516 estimates thefrequency response revenue using the following equation:Rev(Reg _(award))=PS ·Reg _(award)(CP _(cap) +MR ·CP _(perf))where Reg_(award), CP_(cap), MR, and CP_(perf) are provided as knowninputs and PS is the performance score.

Low level controller 308 is shown to include a performance scorecalculator 518. Performance score calculator 518 may calculate theperformance score PS used in the revenue function. The performance scorePS may be based on several factors that indicate how well the optimalfrequency response Res_(FR) tracks the regulation signal Reg_(signal).In some embodiments, the performance score PS is a composite weightingof an accuracy score, a delay score, and a precision score. Performancescore calculator 518 may calculate the performance score PS using theperformance score model shown in the following equation:PS=⅓PS _(acc)+⅓PS _(delay)+⅓PS _(prec)

where PS_(acc) is the accuracy score, PS_(delay) is the delay score, andPS_(prec) is the precision score. In some embodiments, each term in theprecision score is assigned an equal weighting (e.g., ⅓). In otherembodiments, some terms may be weighted higher than others. Each of theterms in the performance score model may be calculated as previouslydescribed with reference to FIG. 4.

Estimating Battery Degradation

Still referring to FIG. 5, low level controller 308 is shown to includea battery degradation estimator 520. Battery degradation estimator 520may be the same or similar to battery degradation estimator 430, withthe exception that battery degradation estimator 520 predicts thebattery degradation that will result from the frequency responseRes_(FR) rather than the original regulation signal Reg_(signal). Theestimated battery degradation may be used as the term λ_(batt) in theobjective function J. Frequency response optimizer 514 may use theestimated battery degradation along with other terms in the objectivefunction J to determine an optimal frequency response Res_(FR).

In some embodiments, battery degradation estimator 520 uses a batterylife model to predict a loss in battery capacity that will result fromthe frequency response Res_(FR). The battery life model may define theloss in battery capacity C_(loss,add) as a sum of multiple piecewiselinear functions, as shown in the following equation:C _(loss,add) =f ₁(T _(cell))+f ₂(SOC)+f ₃(DOD)+f ₄(PR)+f ₅(ER)−C_(loss,nom)where T_(cell) is the cell temperature, SOC is the state-of-charge, DODis the depth of discharge, PR is the average power ratio

$\left( {{e.g.},{{PR} = {{avg}\left( \frac{P_{avg}}{P_{des}} \right)}}} \right),$and ER is the average effort ratio (e.g.,

${ER} = {{avg}\left( \frac{\Delta\; P_{bat}}{P_{des}} \right)}$of battery 108. C_(loss,nom) is the nominal loss in battery capacitythat is expected to occur over time. Therefore, C_(loss,add) representsthe additional loss in battery capacity degradation in excess of thenominal value C_(loss,nom.) The terms in the battery life model may becalculated as described with reference to FIG. 4, with the exceptionthat the frequency response Res_(FR) is used in place of the regulationsignal Reg_(signal).

Still referring to FIG. 5, low level controller 308 is shown to includea revenue loss estimator 522. Revenue loss estimator 522 may be the sameor similar to revenue loss estimator 432, as described with reference toFIG. 4. For example, revenue loss estimator 522 may be configured toestimate an amount of potential revenue that will be lost as a result ofthe battery capacity loss C_(loss,add). In some embodiments, revenueloss estimator 522 converts battery capacity loss C_(loss,add) into lostrevenue using the following equation:R _(loss)=(CP _(cap) +MR ·CP _(perf))C _(loss,add) P _(des)where R_(loss) is the lost revenue over the duration of the frequencyresponse period.

Revenue loss estimator 522 may determine a present value of the revenueloss R_(loss) using the following equation:

$\lambda_{bat} = {\left\lbrack \frac{1 - \left( {1 + \frac{i}{n}} \right)^{- n}}{\frac{i}{n}} \right\rbrack R_{loss}}$where n is the total number of frequency response periods (e.g., hours)during which the revenue loss occurs and λ_(bat) is the present value ofthe revenue loss during the ith frequency response period. In someembodiments, the revenue loss occurs over ten years (e.g., n=87,600hours). Revenue loss estimator 522 may provide the present value of therevenue loss λ_(bat) to frequency response optimizer 514 for use in theobjective function J.

Frequency response optimizer 514 may use the estimated performance scoreand the estimated battery degradation to define the terms in objectivefunction J. Frequency response optimizer 514 may determine values forfrequency response Res_(FR) that optimize objective function J. Invarious embodiments, frequency response optimizer 514 may use sequentialquadratic programming, dynamic programming, or any other optimizationtechnique.

Communication Structure of Optimization Controller

Turning now to FIG. 6, a block diagram illustrating the interconnectionsbetween various components of system 100 is shown, according to someembodiments. As described above, system 100 may receive data from anincentive provider 114. Incentive provider 114 may provide pricinginformation from utilities 320, as well as the regulation signals ARegand RegA. In one embodiment, the pricing information and the regulationsignals may be provided to a network 602. Network 602 may provide accessto the data via an internet connection. In some examples, network 602may encrypt the data or limit access to those with the appropriatepermissions. In some embodiments, network 602 may be a local networkwithin system 100. The pricing information may be provided to network602 via a web service server 604. Further, the regulation signals may beprovided to network 602 via a Modbus client 606. However, othercommunication clients can also be used. Additionally, weather data maybe provided to network 602 via web service 608.

A router 610 may be in communication with network 602. In oneembodiment, router 610 may be in communication with network 602 over awired connection such as Ethernet. In other embodiments, router 610 maybe in communication with network 602 via a wireless connection, such asWi-Fi. In one embodiment, router 610 may be a Merakai router from Cisco.In some embodiments, router 610 may be a multiple gigabit router toallow for fast, large-scale data transfers from network 602 to highlevel controller 306. High level controller 306 may receive the datafrom network 602 via a communication interface 612. Communicationsinterface 612 may include wired or wireless interfaces (e.g., jacks,antennas, transmitters, receivers, transceivers, wire terminals, etc.)for conducting data communications with various systems, devices, ornetworks. For example, communications interface 612 may include anEthernet card and port for sending and receiving data via anEthernet-based communications network and/or a Wi-Fi transceiver forcommunicating via a wireless communications network. Communicationsinterface 612 may be configured to communicate via local area networksor wide area networks (e.g., the Internet, a building WAN, etc.) and mayuse a variety of communications protocols (e.g., BACnet, MODBUS, CAN,IP, LON, etc.).

High level controller 306 is shown to include a server 614. Withinserver 614, one or more virtual machines may exist. For example, server614 may include a high level control virtual machine 616. High levelcontrol virtual machine 616 may perform the functions of high levelcontroller 306 described above. Server 614 may further include a datacollection and control machine. Data collection and control machine 618may include a supervisory control and data acquisition (SCADA) clientfor acquiring data received via the network 602, as well as datareceived from low level controller 308. Data collection and controlmachine 618 may then provide the necessary data to high level controlvirtual machine 616 or low level controller 308, as needed. In someembodiments, server 614 includes an optional virtual machine 620 forsimulating optimizations of a battery system.

High level controller 306 may further include a communication interface622 for communicating with an internal router 624. Communicationsinterface 622 may include wired or wireless interfaces (e.g., jacks,antennas, transmitters, receivers, transceivers, wire terminals, etc.)for conducting data communications with various systems, devices, ornetworks. For example, communications interface 622 may include anEthernet card and port for sending and receiving data via anEthernet-based communications network and/or a Wi-Fi transceiver forcommunicating via a wireless communications network. Communicationsinterface 622 may be configured to communicate via local area networksor wide area networks (e.g., the Internet, a building WAN, etc.) and mayuse a variety of communications protocols (e.g., BACnet, MODBUS, CAN,IP, LON, etc.).

Internal router 624 may further be in communication with network 602 onthe other side of a firewall 626. Firewall 626 may provide a wide areanetwork (WAN) 628 for communication with internal router 624. Firewall626 serves to isolate low level controller 308 from the larger network602. This can provide additional security, such as by protecting lowlevel controller against unauthorized access. Further, by isolating lowlevel controller 308 from the larger network 602, low level controller308 is further protected against vulnerabilities of the larger network602 being exploited, which could potentially effect or damage batterysystem 304. However, firewall 626 can allow authorized information to bepassed from network 602 to WAN 628. This can allow low level controller308 access to data on network 602, such as pricing, or otherconfiguration data from a user interface, such as user interface 630.Low level controller 308 is in communication with internal router 624,and thereby has access to data from network 602, as well as data fromhigh level controller 306, such as the midpoints discussed above.

Low level controller 308 may communicate with one or more IOMs 319and/or battery system 304 via communication link 632. In one embodiment,the communication link 632 may use a Modbus/TCP communication protocol.However, the communication link 632 may also use other communicationprotocols such as CAN, TCP/IP, IP, or other applicable communicationprotocols. This allows the low level controller 308 to quicklycommunicate and control the battery system, as described above.

Further, FIG. 6 shows a user interface 630. While optimizationcontroller 112 is configured to generally be autonomous, user interface630 may allow for installation, configuration and supervision by a user.In one embodiment, user interface 630 may act as an administrator,allowing for configuration of optimization controller 112, as well asbattery system 304. In other embodiments, user interface 630 may act asan operator, allowing a user to interface with optimization controller112 and battery system 304 in regards to general operations. Generaloperations can include monitoring, troubleshooting, and incidentresponse. In one embodiment, user interface 630 may be a stationarydevice such as a personal computer or a dedicated control interface. Inother embodiments, user interface 630 may be a portable device such as alaptop computer, a tablet computer (iPad, Android Table, MicrosoftSurface), a smart phone (iPhone, Windows Phone, Android Phones, etc.),or other mobile device. User interface 630 may communicate with highlevel controller 306 or low level controller 308 via network 602.

Configuration of Exemplary Embodiments

The construction and arrangement of the systems and methods as shown inthe various exemplary embodiments are illustrative only. Although only afew embodiments have been described in detail in this disclosure, manymodifications are possible (e.g., variations in sizes, dimensions,structures, shapes and proportions of the various elements, values ofparameters, mounting arrangements, use of materials, colors,orientations, etc.). For example, the position of elements may bereversed or otherwise varied and the nature or number of discreteelements or positions may be altered or varied. Accordingly, all suchmodifications are intended to be included within the scope of thepresent disclosure. The order or sequence of any process or method stepsmay be varied or re-sequenced according to alternative embodiments.Other substitutions, modifications, changes, and omissions may be madein the design, operating conditions and arrangement of the exemplaryembodiments without departing from the scope of the present disclosure.

The present disclosure contemplates methods, systems and programproducts on any machine-readable media for accomplishing variousoperations. The embodiments of the present disclosure may be implementedusing existing computer processors, or by a special purpose computerprocessor for an appropriate system, incorporated for this or anotherpurpose, or by a hardwired system. Embodiments within the scope of thepresent disclosure include program products comprising machine-readablemedia for carrying or having machine-executable instructions or datastructures stored thereon. Such machine-readable media can be anyavailable media that can be accessed by a general purpose or specialpurpose computer or other machine with a processor. By way of example,such machine-readable media can comprise RAM, ROM, EPROM, EEPROM, CD-ROMor other optical disk storage, magnetic disk storage or other magneticstorage devices, or any other medium which can be used to carry or storedesired program code in the form of machine-executable instructions ordata structures and which can be accessed by a general purpose orspecial purpose computer or other machine with a processor. Combinationsof the above are also included within the scope of machine-readablemedia. Machine-executable instructions include, for example,instructions and data which cause a general purpose computer, specialpurpose computer, or special purpose processing machines to perform acertain function or group of functions.

Although the figures show a specific order of method steps, the order ofthe steps may differ from what is depicted. Also two or more steps maybe performed concurrently or with partial concurrence. Such variationwill depend on the software and hardware systems chosen and on designerchoice. All such variations are within the scope of the disclosure.Likewise, software implementations could be accomplished with standardprogramming techniques with rule based logic and other logic toaccomplish the various connection steps, processing steps, comparisonsteps and decision steps.

What is claimed is:
 1. A frequency response optimization systemcomprising: a battery configured to store and discharge electric power;a power inverter configured to control an amount of the electric powerstored or discharged from the battery at each of a plurality of timesteps during a frequency response period; a high level controllerconfigured to: receive a regulation signal from an incentive provider,determine statistics of the regulation signal, and uses the statisticsof the regulation signal to generate a frequency response midpoint thatmaintains the battery at the same state-of-charge at a beginning and anend of the frequency response period while participating in a frequencyresponse program; a low level controller configured to use the midpointto determine optimal battery power setpoints for the power inverter; andwherein the power inverter is configured to use the optimal batterypower setpoints to control the amount of the electric power stored ordischarged from the battery.
 2. The frequency response optimizationsystem of claim 1, wherein the low level controller is a networkautomation engine controller.
 3. The frequency response optimizationsystem of claim 2, wherein the low level controller is configured tocommunicate with a battery management unit configured to monitor one ormore parameters associated with the battery.
 4. The frequency responseoptimization system of claim 3, wherein the parameters include at leastone of a state of charge (SOC) of the battery, a depth of discharge ofthe battery, and a battery cell temperature.
 5. The frequency responseoptimization system of claim 1, wherein the low level controller isconfigured to communicate with an input/output module in communicationwith one or more sub-systems associated with the battery.
 6. Thefrequency response optimization system of claim 5, wherein the one ormore sub-systems includes an environmental system configured to regulatethe environment of the battery.
 7. The frequency response optimizationsystem of claim 5, wherein the one or more sub-systems includes a safetysystem configured to provide safety and security information related tothe battery to the low level controller.
 8. The frequency responseoptimization system of claim 1, wherein the high level controllercomprises a battery power loss estimator configured to estimate anamount of power lost in the battery based on the statistics of theregulation signal.
 9. The frequency response optimization system ofclaim 1, wherein the high level controller is configured to generatefilter parameters based on the midpoint; and the low level controller isconfigured to use the filter parameters to filter the regulation signaland determine the optimal battery power setpoints using the filteredregulation signal.
 10. The frequency response optimization system ofclaim 1, wherein the high level controller is configured to generate anobjective function comprising: an estimated amount of frequency responserevenue that will result from the battery power setpoints; and anestimated cost of battery degradation that will result from the batterypower setpoints.
 11. The frequency response optimization system of claim10, wherein the high level controller is configured to implementconstraints on the objective function, the constraints comprising atleast one of: constraining a state-of-charge of the battery between aminimum state-of-charge and a maximum state-of-charge; and constrainingthe midpoint such that a sum of the midpoint and a campus power usagedoes not exceed a maximum power rating of the power inverter.
 12. Thefrequency response optimization system of claim 1, wherein the highlevel controller is configured to use a battery life model to determinean estimated cost of battery degradation, the battery life modelcomprising a plurality of variables that depend on the battery powersetpoints, the variables comprising at least one of: a temperature ofthe battery; a state-of-charge of the battery; a depth of discharge ofthe battery; a power ratio of the battery; and an effort ratio of thebattery.
 13. A frequency response optimization system comprising: abattery configured to store and discharge electric power; a powerinverter configured to control an amount of the electric power stored ordischarged from the battery at each of a plurality of time steps duringa frequency response period; and a high level controller configured to:receive a regulation signal from an incentive provider, determinestatistics of the regulation signal, and use the statistics of theregulation signal to generate an optimal frequency response midpointthat achieves a desired change in the state-of-charge of the batterywhile participating in a frequency response program; a low levelcontroller configured to use the midpoints to determine optimal batterypower setpoints for the power inverter; wherein the power inverter isconfigured to use the optimal battery power setpoints to control theamount of the electric power stored or discharged from the battery. 14.The frequency response optimization system of claim 13, wherein the highlevel controller comprises a battery power loss estimator configured toestimate an amount of power lost in the battery based on the statisticsof the regulation signal.
 15. The frequency response optimization systemof claim 13, wherein the high level controller is configured to generatefilter parameters based on the optimal midpoint; and the low levelcontroller is configured to use the filter parameters to filter theregulation signal and determines the optimal battery power setpointsusing the filtered regulation signal.
 16. The frequency responseoptimization system of claim 13, wherein the high level controller isconfigured to generate an objective function comprising: an estimatedamount of frequency response revenue that will result from the midpoint;and an estimated cost of battery degradation that will result from themidpoint.
 17. The frequency response optimization system of claim 16,wherein the high level controller is configured to implement constraintson the objective function, the constraints comprising at least one of:constraining a state-of-charge of the battery between a minimumstate-of-charge and a maximum state-of-charge; and constraining themidpoint such that a sum of the midpoint and a campus power usage doesnot exceed a maximum power rating of the power inverter.
 18. Anoptimization controller for a battery, the optimization controllercomprising: a high level controller configured to receive a regulationsignal from an incentive provider, determine statistics of theregulation signal, and use the statistics of the regulation signal togenerate a frequency response midpoint; and a low level controllerconfigured to use the frequency response midpoint to determine optimalbattery power setpoints and use the optimal battery power setpoints tocontrol an amount of electric power stored or discharged from thebattery during a frequency response period.
 19. The optimizationcontroller of claim 18, wherein the high level controller is configuredto determine the frequency response midpoint that maintains the batteryat the same state-of-charge at a beginning and an end of the frequencyresponse period while participating in a frequency response program. 20.The optimization controller of claim 18, wherein the high levelcontroller is configured to determine an optimal frequency responsemidpoint that achieves a desired change in the state-of-charge of thebattery while participating in a frequency response program.